Merge remote-tracking branch 'uptream/develop' into 7.0-1
# Conflicts: # htdocs/fourn/facture/paiement.php
This commit is contained in:
commit
bc2ed17703
@ -49,6 +49,8 @@ if (empty($argv[1]))
|
|||||||
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";
|
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;
|
exit -1;
|
||||||
}
|
}
|
||||||
|
parse_str($argv[1]);
|
||||||
|
|
||||||
$i=0;
|
$i=0;
|
||||||
while ($i < $argc)
|
while ($i < $argc)
|
||||||
{
|
{
|
||||||
@ -98,9 +100,9 @@ foreach ($includeconstants as $countrycode => $tmp)
|
|||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
|
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
|
||||||
$outputdir=dirname(__FILE__).'/../htdocs/install';
|
$outputdir=dirname(dirname(__FILE__)).'/htdocs/install';
|
||||||
print 'Delete current files '.$outputdir.'/filelist-'.$release.'.xml'."\n";
|
print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
|
||||||
dol_delete_file($outputdir.'/filelist-'.$release.'.xml',0,1,1);
|
dol_delete_file($outputdir.'/filelist*.xml',0,1,1);
|
||||||
|
|
||||||
$checksumconcat=array();
|
$checksumconcat=array();
|
||||||
|
|
||||||
|
|||||||
9419
dev/initdemo/mysqldump_dolibarr_6.0.0.sql
Normal file
9419
dev/initdemo/mysqldump_dolibarr_6.0.0.sql
Normal file
File diff suppressed because one or more lines are too long
@ -192,6 +192,7 @@ export list="
|
|||||||
--ignore-table=$base.llx_cabinetmed_c_ccam
|
--ignore-table=$base.llx_cabinetmed_c_ccam
|
||||||
--ignore-table=$base.llx_cabinetmed_c_examconclusion
|
--ignore-table=$base.llx_cabinetmed_c_examconclusion
|
||||||
--ignore-table=$base.llx_cabinetmed_cons
|
--ignore-table=$base.llx_cabinetmed_cons
|
||||||
|
--ignore-table=$base.llx_cabinetmed_cons_extrafields
|
||||||
--ignore-table=$base.llx_cabinetmed_diaglec
|
--ignore-table=$base.llx_cabinetmed_diaglec
|
||||||
--ignore-table=$base.llx_cabinetmed_examaut
|
--ignore-table=$base.llx_cabinetmed_examaut
|
||||||
--ignore-table=$base.llx_cabinetmed_exambio
|
--ignore-table=$base.llx_cabinetmed_exambio
|
||||||
@ -207,7 +208,18 @@ export list="
|
|||||||
--ignore-table=$base.llx_dolicloud_customers
|
--ignore-table=$base.llx_dolicloud_customers
|
||||||
--ignore-table=$base.llx_dolicloud_stats
|
--ignore-table=$base.llx_dolicloud_stats
|
||||||
--ignore-table=$base.llx_dolicloud_emailstemplates
|
--ignore-table=$base.llx_dolicloud_emailstemplates
|
||||||
|
--ignore-table=$base.llx_dolireport_column
|
||||||
|
--ignore-table=$base.llx_dolireport_criteria
|
||||||
|
--ignore-table=$base.llx_dolireport_graph
|
||||||
|
--ignore-table=$base.llx_dolireport_plot
|
||||||
|
--ignore-table=$base.llx_dolireport_report
|
||||||
--ignore-table=$base.llx_domain
|
--ignore-table=$base.llx_domain
|
||||||
|
--ignore-table=$base.llx_ecommerce_commande
|
||||||
|
--ignore-table=$base.llx_ecommerce_facture
|
||||||
|
--ignore-table=$base.llx_ecommerce_product
|
||||||
|
--ignore-table=$base.llx_ecommerce_site
|
||||||
|
--ignore-table=$base.llx_ecommerce_societe
|
||||||
|
--ignore-table=$base.llx_ecommerce_socpeople
|
||||||
--ignore-table=$base.llx_element_rang
|
--ignore-table=$base.llx_element_rang
|
||||||
--ignore-table=$base.llx_entity
|
--ignore-table=$base.llx_entity
|
||||||
--ignore-table=$base.llx_filemanager_roots
|
--ignore-table=$base.llx_filemanager_roots
|
||||||
@ -215,6 +227,8 @@ export list="
|
|||||||
--ignore-table=$base.llx_google_maps
|
--ignore-table=$base.llx_google_maps
|
||||||
--ignore-table=$base.llx_milestone
|
--ignore-table=$base.llx_milestone
|
||||||
--ignore-table=$base.llx_monitoring_probes
|
--ignore-table=$base.llx_monitoring_probes
|
||||||
|
--ignore-table=$base.llx_m
|
||||||
|
--ignore-table=$base.llx_m_extrafields
|
||||||
--ignore-table=$base.llx_notes
|
--ignore-table=$base.llx_notes
|
||||||
--ignore-table=$base.llx_pos_cash
|
--ignore-table=$base.llx_pos_cash
|
||||||
--ignore-table=$base.llx_pos_control_cash
|
--ignore-table=$base.llx_pos_control_cash
|
||||||
|
|||||||
BIN
doc/images/dolibarr_screenshot5_1920x1080_a.jpg
Normal file
BIN
doc/images/dolibarr_screenshot5_1920x1080_a.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 223 KiB |
BIN
doc/images/dolibarr_screenshot5_1920x1080_b.jpg
Normal file
BIN
doc/images/dolibarr_screenshot5_1920x1080_b.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 124 KiB |
@ -158,6 +158,7 @@ class Adherent extends CommonObject
|
|||||||
$from=$conf->email_from;
|
$from=$conf->email_from;
|
||||||
if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM;
|
if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM;
|
||||||
|
|
||||||
|
// Send email (substitutionarray must be done just before this)
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||||
$mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml);
|
$mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml);
|
||||||
if ($mailfile->sendfile())
|
if ($mailfile->sendfile())
|
||||||
|
|||||||
@ -46,13 +46,18 @@ if ($action == 'test' || $action == 'send')
|
|||||||
}
|
}
|
||||||
|
|
||||||
$substitutionarrayfortest=array(
|
$substitutionarrayfortest=array(
|
||||||
'__LOGIN__' => $user->login,
|
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||||
'__ID__' => 'TESTIdRecord',
|
'__ID__' => 'RecipientIdRecord',
|
||||||
'__EMAIL__' => 'TESTEMail',
|
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
|
||||||
'__LASTNAME__' => 'TESTLastname',
|
'__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty))?'<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>':'',
|
||||||
'__FIRSTNAME__' => 'TESTFirstname',
|
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''), // Done into actions_sendmails
|
||||||
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''),
|
'__LOGIN__' => 'RecipientLogin',
|
||||||
//'__PERSONALIZED__' => 'TESTPersonalized' // Hiden because not used yet
|
'__LASTNAME__' => 'RecipientLastname',
|
||||||
|
'__FIRSTNAME__' => 'RecipientFirstname',
|
||||||
|
'__ADDRESS__'=> 'RecipientAddress',
|
||||||
|
'__ZIP__'=> 'RecipientZip',
|
||||||
|
'__TOWN_'=> 'RecipientTown',
|
||||||
|
'__COUNTRY__'=> 'RecipientCountry'
|
||||||
);
|
);
|
||||||
complete_substitutions_array($substitutionarrayfortest, $langs);
|
complete_substitutions_array($substitutionarrayfortest, $langs);
|
||||||
|
|
||||||
|
|||||||
@ -62,14 +62,15 @@ class Categorie extends CommonObject
|
|||||||
* @note This array should be remove in future, once previous constants are moved to the string value. Deprecated
|
* @note This array should be remove in future, once previous constants are moved to the string value. Deprecated
|
||||||
*/
|
*/
|
||||||
private $MAP_ID = array(
|
private $MAP_ID = array(
|
||||||
'product' => 0,
|
'product' => 0,
|
||||||
'supplier' => 1,
|
'supplier' => 1,
|
||||||
'customer' => 2,
|
'customer' => 2,
|
||||||
'member' => 3,
|
'member' => 3,
|
||||||
'contact' => 4,
|
'contact' => 4,
|
||||||
'account' => 5,
|
'bank_account' => 5,
|
||||||
'project' => 6,
|
'project' => 6,
|
||||||
'user' => 7,
|
'user' => 7,
|
||||||
|
'bank_line' => 8,
|
||||||
);
|
);
|
||||||
public static $MAP_ID_TO_CODE = array(
|
public static $MAP_ID_TO_CODE = array(
|
||||||
0 => 'product',
|
0 => 'product',
|
||||||
@ -77,9 +78,10 @@ class Categorie extends CommonObject
|
|||||||
2 => 'customer',
|
2 => 'customer',
|
||||||
3 => 'member',
|
3 => 'member',
|
||||||
4 => 'contact',
|
4 => 'contact',
|
||||||
5 => 'account',
|
5 => 'bank_account',
|
||||||
6 => 'project',
|
6 => 'project',
|
||||||
7 => 'user',
|
7 => 'user',
|
||||||
|
8 => 'bank_line',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -94,7 +96,8 @@ class Categorie extends CommonObject
|
|||||||
'member' => 'member',
|
'member' => 'member',
|
||||||
'contact' => 'socpeople',
|
'contact' => 'socpeople',
|
||||||
'user' => 'user',
|
'user' => 'user',
|
||||||
'account' => 'account',
|
'account' => 'account', // old for bank_account
|
||||||
|
'bank_account' => 'account',
|
||||||
'project' => 'project',
|
'project' => 'project',
|
||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
@ -109,7 +112,8 @@ class Categorie extends CommonObject
|
|||||||
'member' => 'member',
|
'member' => 'member',
|
||||||
'contact' => 'contact',
|
'contact' => 'contact',
|
||||||
'user' => 'user',
|
'user' => 'user',
|
||||||
'account' => 'account',
|
'account' => 'account', // old for bank_account
|
||||||
|
'bank_account'=> 'account',
|
||||||
'project' => 'project',
|
'project' => 'project',
|
||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
@ -124,7 +128,8 @@ class Categorie extends CommonObject
|
|||||||
'member' => 'Adherent',
|
'member' => 'Adherent',
|
||||||
'contact' => 'Contact',
|
'contact' => 'Contact',
|
||||||
'user' => 'User',
|
'user' => 'User',
|
||||||
'account' => 'Account',
|
'account' => 'Account', // old for bank account
|
||||||
|
'bank_account' => 'Account',
|
||||||
'project' => 'Project',
|
'project' => 'Project',
|
||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
@ -947,8 +952,8 @@ class Categorie extends CommonObject
|
|||||||
* fulllabel = nom avec chemin complet de la categorie
|
* fulllabel = nom avec chemin complet de la categorie
|
||||||
* fullpath = chemin complet compose des id
|
* fullpath = chemin complet compose des id
|
||||||
*
|
*
|
||||||
* @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...).
|
* @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...).
|
||||||
* @param int $markafterid Removed all categories including the leaf $markafterid in category tree.
|
* @param int $markafterid Removed all categories including the leaf $markafterid in category tree.
|
||||||
*
|
*
|
||||||
* @return array Array of categories. this->cats and this->motherof are set.
|
* @return array Array of categories. this->cats and this->motherof are set.
|
||||||
*/
|
*/
|
||||||
@ -1340,11 +1345,11 @@ class Categorie extends CommonObject
|
|||||||
* Return list of categories (object instances or labels) linked to element of id $id and type $type
|
* Return list of categories (object instances or labels) linked to element of id $id and type $type
|
||||||
* Should be named getListOfCategForObject
|
* Should be named getListOfCategForObject
|
||||||
*
|
*
|
||||||
* @param int $id Id of element
|
* @param int $id Id of element
|
||||||
* @param int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...)
|
* @param string|int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...)
|
||||||
* @param string $mode 'id'=Get array of category ids, 'object'=Get array of fetched category instances, 'label'=Get array of category
|
* @param string $mode 'id'=Get array of category ids, 'object'=Get array of fetched category instances, 'label'=Get array of category
|
||||||
* labels, 'id'= Get array of category IDs
|
* labels, 'id'= Get array of category IDs
|
||||||
* @return mixed Array of category objects or < 0 if KO
|
* @return mixed Array of category objects or < 0 if KO
|
||||||
*/
|
*/
|
||||||
function containing($id, $type, $mode='object')
|
function containing($id, $type, $mode='object')
|
||||||
{
|
{
|
||||||
@ -1352,7 +1357,7 @@ class Categorie extends CommonObject
|
|||||||
|
|
||||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type];
|
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type];
|
||||||
|
|
||||||
if ($type == Categorie::TYPE_BANK_LINE) // TODO Remove this with standard category code
|
if ($type === Categorie::TYPE_BANK_LINE) // TODO Remove this with standard category code
|
||||||
{
|
{
|
||||||
// Load bank groups
|
// Load bank groups
|
||||||
$sql = "SELECT c.label, c.rowid";
|
$sql = "SELECT c.label, c.rowid";
|
||||||
|
|||||||
@ -54,7 +54,7 @@ elseif ($type == Categorie::TYPE_SUPPLIER) { $title=$langs->trans("SuppliersCat
|
|||||||
elseif ($type == Categorie::TYPE_CUSTOMER) { $title=$langs->trans("CustomersCategoriesArea"); $typetext='customer'; }
|
elseif ($type == Categorie::TYPE_CUSTOMER) { $title=$langs->trans("CustomersCategoriesArea"); $typetext='customer'; }
|
||||||
elseif ($type == Categorie::TYPE_MEMBER) { $title=$langs->trans("MembersCategoriesArea"); $typetext='member'; }
|
elseif ($type == Categorie::TYPE_MEMBER) { $title=$langs->trans("MembersCategoriesArea"); $typetext='member'; }
|
||||||
elseif ($type == Categorie::TYPE_CONTACT) { $title=$langs->trans("ContactsCategoriesArea"); $typetext='contact'; }
|
elseif ($type == Categorie::TYPE_CONTACT) { $title=$langs->trans("ContactsCategoriesArea"); $typetext='contact'; }
|
||||||
elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCategoriesArea"); $typetext='account'; }
|
elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCategoriesArea"); $typetext='bank_account'; }
|
||||||
elseif ($type == Categorie::TYPE_PROJECT) { $title=$langs->trans("ProjectsCategoriesArea"); $typetext='project'; }
|
elseif ($type == Categorie::TYPE_PROJECT) { $title=$langs->trans("ProjectsCategoriesArea"); $typetext='project'; }
|
||||||
elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; }
|
elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; }
|
||||||
else { $title=$langs->trans("CategoriesArea"); $typetext='unknown'; }
|
else { $title=$langs->trans("CategoriesArea"); $typetext='unknown'; }
|
||||||
|
|||||||
@ -61,7 +61,7 @@ $object->substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation
|
|||||||
|
|
||||||
$object->substitutionarrayfortest=array(
|
$object->substitutionarrayfortest=array(
|
||||||
'__ID__' => 'TESTIdRecord',
|
'__ID__' => 'TESTIdRecord',
|
||||||
'__EMAIL__' => 'TESTEMail',
|
//'__EMAIL__' => 'TESTEMail', // Done into "send" action
|
||||||
'__LASTNAME__' => 'TESTLastname',
|
'__LASTNAME__' => 'TESTLastname',
|
||||||
'__FIRSTNAME__' => 'TESTFirstname',
|
'__FIRSTNAME__' => 'TESTFirstname',
|
||||||
'__MAILTOEMAIL__' => 'TESTMailtoEmail',
|
'__MAILTOEMAIL__' => 'TESTMailtoEmail',
|
||||||
@ -409,6 +409,8 @@ if (empty($reshook))
|
|||||||
$msgishtml=-1; // Inconnu par defaut
|
$msgishtml=-1; // Inconnu par defaut
|
||||||
if (preg_match('/[\s\t]*<html>/i',$object->body)) $msgishtml=1;
|
if (preg_match('/[\s\t]*<html>/i',$object->body)) $msgishtml=1;
|
||||||
|
|
||||||
|
$object->substitutionarrayfortest['__EMAIL__'] = $object->sendto; // other are set at begin of page
|
||||||
|
|
||||||
// Pratique les substitutions sur le sujet et message
|
// Pratique les substitutions sur le sujet et message
|
||||||
$tmpsujet=make_substitutions($object->sujet,$object->substitutionarrayfortest);
|
$tmpsujet=make_substitutions($object->sujet,$object->substitutionarrayfortest);
|
||||||
$tmpbody=make_substitutions($object->body,$object->substitutionarrayfortest);
|
$tmpbody=make_substitutions($object->body,$object->substitutionarrayfortest);
|
||||||
|
|||||||
@ -560,11 +560,7 @@ else
|
|||||||
$_GET["id"]=$object->id;
|
$_GET["id"]=$object->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Show tabs
|
||||||
* Affichage onglets
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Onglets
|
|
||||||
$head=bank_prepare_head($object);
|
$head=bank_prepare_head($object);
|
||||||
dol_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"), -1, 'account');
|
dol_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"), -1, 'account');
|
||||||
|
|
||||||
@ -592,18 +588,6 @@ else
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
|
||||||
// Ref
|
|
||||||
/*
|
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
|
|
||||||
print '<td>';
|
|
||||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref');
|
|
||||||
print '</td></tr>';*/
|
|
||||||
|
|
||||||
// Label
|
|
||||||
/*print '<tr><td class="titlefield">'.$langs->trans("Label").'</td>';
|
|
||||||
print '<td>'.$object->label.'</td></tr>';*/
|
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("AccountType").'</td>';
|
print '<tr><td class="titlefield">'.$langs->trans("AccountType").'</td>';
|
||||||
print '<td>'.$object->type_lib[$object->type].'</td></tr>';
|
print '<td>'.$object->type_lib[$object->type].'</td></tr>';
|
||||||
@ -616,26 +600,6 @@ else
|
|||||||
print $langs->trans("Currency".$selectedcode);
|
print $langs->trans("Currency".$selectedcode);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Status
|
|
||||||
/*print '<tr><td>'.$langs->trans("Status").'</td>';
|
|
||||||
print '<td>'.$object->getLibStatut(4).'</td></tr>';*/
|
|
||||||
|
|
||||||
// Country
|
|
||||||
/*
|
|
||||||
print '<tr><td>'.$langs->trans("BankAccountCountry").'</td><td>';
|
|
||||||
if ($object->country_id > 0)
|
|
||||||
{
|
|
||||||
$img=picto_from_langcode($object->country_code);
|
|
||||||
print $img?$img.' ':'';
|
|
||||||
print getCountry($object->getCountryCode(),0,$db);
|
|
||||||
}
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// State
|
|
||||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
|
||||||
if ($object->state_id > 0) print getState($object->state_id);
|
|
||||||
print '</td></tr>';*/
|
|
||||||
|
|
||||||
// Conciliate
|
// Conciliate
|
||||||
print '<tr><td>'.$langs->trans("Conciliable").'</td>';
|
print '<tr><td>'.$langs->trans("Conciliable").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -694,7 +658,7 @@ else
|
|||||||
// Categories
|
// Categories
|
||||||
if ($conf->categorie->enabled) {
|
if ($conf->categorie->enabled) {
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td><td>';
|
print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td><td>';
|
||||||
print $form->showCategories($object->id,'account',1);
|
print $form->showCategories($object->id,'bank_account',1);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1276,7 +1276,6 @@ class FactureLigneRec extends CommonInvoiceLine
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".($this->rowid > 0 ? $this->rowid : $this->id);
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".($this->rowid > 0 ? $this->rowid : $this->id);
|
||||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||||
if ($this->db->query($sql) )
|
if ($this->db->query($sql) )
|
||||||
@ -1302,15 +1301,14 @@ class FactureLigneRec extends CommonInvoiceLine
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recupere les lignes de factures predefinies dans this->lines
|
* Recupere les lignes de factures predefinies dans this->lines
|
||||||
* @param int $rowid
|
*
|
||||||
* @return int 1 if OK, < 0 if KO
|
* @param int $rowid Id of invoice
|
||||||
|
* @return int 1 if OK, < 0 if KO
|
||||||
*/
|
*/
|
||||||
function fetch($rowid)
|
function fetch($rowid)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = 'SELECT l.rowid, l.fk_facture ,l.fk_product, l.product_type, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx, ';
|
$sql = 'SELECT l.rowid, l.fk_facture ,l.fk_product, l.product_type, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx, ';
|
||||||
$sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise, l.remise_percent, l.subprice,';
|
$sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise, l.remise_percent, l.subprice,';
|
||||||
$sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_ttc,';
|
$sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_ttc,';
|
||||||
@ -1322,7 +1320,7 @@ class FactureLigneRec extends CommonInvoiceLine
|
|||||||
$sql.= ' WHERE l.rowid = '.$rowid;
|
$sql.= ' WHERE l.rowid = '.$rowid;
|
||||||
$sql.= ' ORDER BY l.rang';
|
$sql.= ' ORDER BY l.rang';
|
||||||
|
|
||||||
dol_syslog('FactureRec::fetch_lines', LOG_DEBUG);
|
dol_syslog('FactureRec::fetch', LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
@ -1376,11 +1374,14 @@ class FactureLigneRec extends CommonInvoiceLine
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update a line to invoice_rec
|
* Update a line to invoice_rec.
|
||||||
|
*
|
||||||
* @return int <0 if KO, Id of line if OK
|
* @return int <0 if KO, Id of line if OK
|
||||||
*/
|
*/
|
||||||
function update()
|
function update()
|
||||||
{
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||||
|
|
||||||
if ($fk_product)
|
if ($fk_product)
|
||||||
@ -1391,7 +1392,7 @@ class FactureLigneRec extends CommonInvoiceLine
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet_rec SET ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet_rec SET ";
|
||||||
$sql.= " fk_facture = '".$this->fk_facture."'";
|
$sql.= " fk_facture = ".$this->fk_facture;
|
||||||
$sql.= ", label=".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null");
|
$sql.= ", label=".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null");
|
||||||
$sql.= ", description='".$this->db->escape($this->desc)."'";
|
$sql.= ", description='".$this->db->escape($this->desc)."'";
|
||||||
$sql.= ", price=".price2num($this->price);
|
$sql.= ", price=".price2num($this->price);
|
||||||
@ -1454,6 +1455,4 @@ class FactureLigneRec extends CommonInvoiceLine
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -158,12 +158,11 @@ if ($action == 'add')
|
|||||||
$params['options'][$key] = $value;
|
$params['options'][$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result=$extrafields->addExtraField(
|
$result=$extrafields->addExtraField(
|
||||||
GETPOST('attrname', 'alpha'),
|
GETPOST('attrname', 'alpha'),
|
||||||
GETPOST('label', 'alpha'),
|
GETPOST('label', 'alpha'),
|
||||||
$type,
|
$type,
|
||||||
GETPOST('pos', 'alpha'),
|
GETPOST('pos', 'int'),
|
||||||
$extrasize,
|
$extrasize,
|
||||||
$elementtype,
|
$elementtype,
|
||||||
(GETPOST('unique', 'alpha')?1:0),
|
(GETPOST('unique', 'alpha')?1:0),
|
||||||
@ -175,8 +174,8 @@ if ($action == 'add')
|
|||||||
(GETPOST('list', 'alpha')?1:0),
|
(GETPOST('list', 'alpha')?1:0),
|
||||||
(GETPOST('ishidden', 'alpha')?1:0),
|
(GETPOST('ishidden', 'alpha')?1:0),
|
||||||
GETPOST('computed_value','alpha'),
|
GETPOST('computed_value','alpha'),
|
||||||
(GETPOST('entitycurrentorall', 'alpha')?0:'')
|
(GETPOST('entitycurrentorall', 'alpha')?0:''),
|
||||||
|
GETPOST('langfile', 'alpha')
|
||||||
);
|
);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
@ -338,7 +337,8 @@ if ($action == 'update')
|
|||||||
(GETPOST('ishidden', 'alpha')?1:0),
|
(GETPOST('ishidden', 'alpha')?1:0),
|
||||||
GETPOST('default_value','alpha'),
|
GETPOST('default_value','alpha'),
|
||||||
GETPOST('computed_value','alpha'),
|
GETPOST('computed_value','alpha'),
|
||||||
(GETPOST('entitycurrentorall', 'alpha')?0:'')
|
(GETPOST('entitycurrentorall', 'alpha')?0:''),
|
||||||
|
GETPOST('langfile')
|
||||||
);
|
);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -83,7 +83,7 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
$result=$objecttmp->fetch($toselectid);
|
$result=$objecttmp->fetch($toselectid);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$listoinvoicesid[$toselectid]=$toselectid;
|
$listofobjectid[$toselectid]=$toselectid;
|
||||||
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
||||||
$listofobjectthirdparties[$thirdpartyid]=$thirdpartyid;
|
$listofobjectthirdparties[$thirdpartyid]=$thirdpartyid;
|
||||||
$listofobjectref[$thirdpartyid][$toselectid]=$objecttmp;
|
$listofobjectref[$thirdpartyid][$toselectid]=$objecttmp;
|
||||||
@ -170,7 +170,7 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
|
|
||||||
//var_dump($listofobjectref);exit;
|
//var_dump($listofobjectref);exit;
|
||||||
$attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array());
|
$attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array());
|
||||||
$listofqualifiedinvoice=array();
|
$listofqualifiedid=array();
|
||||||
$listofqualifiedref=array();
|
$listofqualifiedref=array();
|
||||||
foreach($listofobjectref[$thirdpartyid] as $objectid => $object)
|
foreach($listofobjectref[$thirdpartyid] as $objectid => $object)
|
||||||
{
|
{
|
||||||
@ -224,7 +224,7 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$listofqualifiedinvoice[$objectid]=$object;
|
$listofqualifiedid[$objectid]=$object;
|
||||||
$listofqualifiedref[$objectid]=$object->ref;
|
$listofqualifiedref[$objectid]=$object->ref;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -239,8 +239,8 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
//var_dump($listofqualifiedref);
|
//var_dump($listofqualifiedref);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop on each qualified invoice of the thirdparty
|
// Loop on each qualified objects of the thirdparty
|
||||||
if (count($listofqualifiedinvoice) > 0)
|
if (count($listofqualifiedid) > 0)
|
||||||
{
|
{
|
||||||
$langs->load("commercial");
|
$langs->load("commercial");
|
||||||
|
|
||||||
@ -267,17 +267,35 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
$subject = GETPOST('subject');
|
$subject = GETPOST('subject');
|
||||||
$message = GETPOST('message');
|
$message = GETPOST('message');
|
||||||
$sendtocc = GETPOST('sentocc');
|
$sendtocc = GETPOST('sentocc');
|
||||||
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
|
$sendtobcc = '';
|
||||||
|
if ($objectclass == 'Propale') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO);
|
||||||
|
if ($objectclass == 'Commande') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO);
|
||||||
|
if ($objectclass == 'Facture') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
|
||||||
|
if ($objectclass == 'Supplier_Proposal') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO);
|
||||||
|
if ($objectclass == 'CommandeFournisseur') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO);
|
||||||
|
if ($objectclass == 'FactureFournisseur') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO);
|
||||||
|
|
||||||
|
|
||||||
$substitutionarray=array(
|
$substitutionarray=array(
|
||||||
'__ID__' => join(', ',array_keys($listofqualifiedinvoice)),
|
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||||
|
'__ID__' => join(', ',array_keys($listofqualifiedid)),
|
||||||
'__EMAIL__' => $thirdparty->email,
|
'__EMAIL__' => $thirdparty->email,
|
||||||
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
|
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
|
||||||
'__FACREF__' => join(', ',$listofqualifiedref), // For backward compatibility
|
'__FACREF__' => join(', ',$listofqualifiedref), // For backward compatibility
|
||||||
'__ORDERREF__' => join(', ',$listofqualifiedref), // For backward compatibility
|
'__ORDERREF__' => join(', ',$listofqualifiedref), // For backward compatibility
|
||||||
'__PROPREF__' => join(', ',$listofqualifiedref), // For backward compatibility
|
'__PROPREF__' => join(', ',$listofqualifiedref), // For backward compatibility
|
||||||
'__REF__' => join(', ',$listofqualifiedref),
|
'__REF__' => join(', ',$listofqualifiedref),
|
||||||
'__REFCLIENT__' => $thirdparty->name
|
'__REFCLIENT__' => $thirdparty->name,
|
||||||
|
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?dol_string_nohtmltag($user->signature):'')
|
||||||
|
/* not available on all object
|
||||||
|
/'__FIRSTNAME__'=>(is_object($object)?$object->firstname:''),
|
||||||
|
'__LASTNAME__'=>(is_object($object)?$object->lastname:''),
|
||||||
|
'__FULLNAME__'=>(is_object($object)?$object->getFullName($langs):''),
|
||||||
|
'__ADDRESS__'=>(is_object($object)?$object->address:''),
|
||||||
|
'__ZIP__'=>(is_object($object)?$object->zip:''),
|
||||||
|
'__TOWN_'=>(is_object($object)?$object->town:''),
|
||||||
|
'__COUNTRY__'=>(is_object($object)?$object->country:''),
|
||||||
|
*/
|
||||||
);
|
);
|
||||||
|
|
||||||
$subject=make_substitutions($subject, $substitutionarray);
|
$subject=make_substitutions($subject, $substitutionarray);
|
||||||
@ -289,7 +307,7 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
|
|
||||||
//var_dump($filepath);
|
//var_dump($filepath);
|
||||||
|
|
||||||
// Send mail
|
// Send mail (substitutionarray must be done just before this)
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
|
||||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
|
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
|
||||||
if ($mailfile->error)
|
if ($mailfile->error)
|
||||||
@ -306,7 +324,7 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
// Insert logs into agenda
|
// Insert logs into agenda
|
||||||
foreach($listofqualifiedinvoice as $invid => $object)
|
foreach($listofqualifiedid as $objid => $object)
|
||||||
{
|
{
|
||||||
/*if ($objectclass == 'Propale') $actiontypecode='AC_PROP';
|
/*if ($objectclass == 'Propale') $actiontypecode='AC_PROP';
|
||||||
if ($objectclass == 'Commande') $actiontypecode='AC_COM';
|
if ($objectclass == 'Commande') $actiontypecode='AC_COM';
|
||||||
@ -329,7 +347,7 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
$object->sendtoid = 0;
|
$object->sendtoid = 0;
|
||||||
$object->actionmsg = $actionmsg; // Long text
|
$object->actionmsg = $actionmsg; // Long text
|
||||||
$object->actionmsg2 = $actionmsg2; // Short text
|
$object->actionmsg2 = $actionmsg2; // Short text
|
||||||
$object->fk_element = $invid;
|
$object->fk_element = $objid;
|
||||||
$object->elementtype = $object->element;
|
$object->elementtype = $object->element;
|
||||||
|
|
||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
@ -404,7 +422,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
|
|||||||
$result=$objecttmp->fetch($toselectid);
|
$result=$objecttmp->fetch($toselectid);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$listoinvoicesid[$toselectid]=$toselectid;
|
$listofobjectid[$toselectid]=$toselectid;
|
||||||
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
||||||
$listofobjectthirdparties[$thirdpartyid]=$thirdpartyid;
|
$listofobjectthirdparties[$thirdpartyid]=$thirdpartyid;
|
||||||
$listofobjectref[$toselectid]=$objecttmp->ref;
|
$listofobjectref[$toselectid]=$objecttmp->ref;
|
||||||
|
|||||||
@ -344,9 +344,31 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send mail
|
$substitutionarray=array(
|
||||||
|
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||||
|
'__ID__' => (is_object($object)?$object->id:''),
|
||||||
|
'__EMAIL__' => $sendto,
|
||||||
|
'__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty))?'<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>':'',
|
||||||
|
'__REF__' => (is_object($object)?$object->ref:''),
|
||||||
|
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?dol_string_nohtmltag($user->signature):'')
|
||||||
|
/* not available on all object
|
||||||
|
/'__FIRSTNAME__'=>(is_object($object)?$object->firstname:''),
|
||||||
|
'__LASTNAME__'=>(is_object($object)?$object->lastname:''),
|
||||||
|
'__FULLNAME__'=>(is_object($object)?$object->getFullName($langs):''),
|
||||||
|
'__ADDRESS__'=>(is_object($object)?$object->address:''),
|
||||||
|
'__ZIP__'=>(is_object($object)?$object->zip:''),
|
||||||
|
'__TOWN_'=>(is_object($object)?$object->town:''),
|
||||||
|
'__COUNTRY__'=>(is_object($object)?$object->country:''),
|
||||||
|
*/
|
||||||
|
);
|
||||||
|
|
||||||
|
$subject=make_substitutions($subject, $substitutionarray);
|
||||||
|
$message=make_substitutions($message, $substitutionarray);
|
||||||
|
|
||||||
|
// Send mail (substitutionarray must be done just before this)
|
||||||
if (empty($sendcontext)) $sendcontext = 'standard';
|
if (empty($sendcontext)) $sendcontext = 'standard';
|
||||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid,'',$sendcontext);
|
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid,'', $sendcontext);
|
||||||
|
|
||||||
if ($mailfile->error)
|
if ($mailfile->error)
|
||||||
{
|
{
|
||||||
setEventMessage($mailfile->error, 'errors');
|
setEventMessage($mailfile->error, 'errors');
|
||||||
|
|||||||
@ -38,6 +38,7 @@ class CMailFile
|
|||||||
{
|
{
|
||||||
public $sendcontext;
|
public $sendcontext;
|
||||||
public $sendmode;
|
public $sendmode;
|
||||||
|
public $sendsetup;
|
||||||
|
|
||||||
var $subject; // Topic: Subject of email
|
var $subject; // Topic: Subject of email
|
||||||
var $addr_from; // From: Label and EMail of sender (must include '<>'). For example '<myemail@example.com>' or 'John Doe <myemail@example.com>' or '<myemail+trackingid@example.com>'). Note that with gmail smtps, value here is forced by google to account (but not the reply-to).
|
var $addr_from; // From: Label and EMail of sender (must include '<>'). For example '<myemail@example.com>' or 'John Doe <myemail@example.com>' or '<myemail+trackingid@example.com>'). Note that with gmail smtps, value here is forced by google to account (but not the reply-to).
|
||||||
@ -170,6 +171,16 @@ class CMailFile
|
|||||||
$this->msgishtml = $msgishtml;
|
$this->msgishtml = $msgishtml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
global $dolibarr_main_url_root;
|
||||||
|
|
||||||
|
// Define $urlwithroot
|
||||||
|
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||||
|
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||||
|
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||||
|
|
||||||
|
// Replace relative /viewimage to absolute path
|
||||||
|
$msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT,'/').'\/viewimage\.php/ims', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1, $nbrep);
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html.
|
if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html.
|
||||||
|
|
||||||
// Detect images
|
// Detect images
|
||||||
|
|||||||
@ -4565,6 +4565,9 @@ abstract class CommonObject
|
|||||||
$e = 0;
|
$e = 0;
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attribute_label as $key=>$label)
|
||||||
{
|
{
|
||||||
|
// Load language if required
|
||||||
|
if (! empty($extrafields->attributes[$this->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]);
|
||||||
|
|
||||||
if (is_array($params) && count($params)>0) {
|
if (is_array($params) && count($params)>0) {
|
||||||
if (array_key_exists('colspan',$params)) {
|
if (array_key_exists('colspan',$params)) {
|
||||||
$colspan=$params['colspan'];
|
$colspan=$params['colspan'];
|
||||||
|
|||||||
@ -64,7 +64,9 @@ class ExtraFields
|
|||||||
var $attribute_alwayseditable;
|
var $attribute_alwayseditable;
|
||||||
// Array to store permission to check
|
// Array to store permission to check
|
||||||
var $attribute_perms;
|
var $attribute_perms;
|
||||||
// Array to store permission to check
|
// Array to store language file to translate label of values
|
||||||
|
var $attribute_langfile;
|
||||||
|
// Array to store if field is visible by default on list
|
||||||
var $attribute_list;
|
var $attribute_list;
|
||||||
// Array to store if extra field is hidden
|
// Array to store if extra field is hidden
|
||||||
var $attribute_hidden; // warning, do not rely on this. If your module need a hidden data, it must use its own table.
|
var $attribute_hidden; // warning, do not rely on this. If your module need a hidden data, it must use its own table.
|
||||||
@ -117,6 +119,7 @@ class ExtraFields
|
|||||||
$this->attribute_unique = array();
|
$this->attribute_unique = array();
|
||||||
$this->attribute_required = array();
|
$this->attribute_required = array();
|
||||||
$this->attribute_perms = array();
|
$this->attribute_perms = array();
|
||||||
|
$this->attribute_langfile = array();
|
||||||
$this->attribute_list = array();
|
$this->attribute_list = array();
|
||||||
$this->attribute_hidden = array();
|
$this->attribute_hidden = array();
|
||||||
}
|
}
|
||||||
@ -124,25 +127,26 @@ class ExtraFields
|
|||||||
/**
|
/**
|
||||||
* Add a new extra field parameter
|
* Add a new extra field parameter
|
||||||
*
|
*
|
||||||
* @param string $attrname Code of attribute
|
* @param string $attrname Code of attribute
|
||||||
* @param string $label label of attribute
|
* @param string $label label of attribute
|
||||||
* @param int $type Type of attribute ('boolean', 'int', 'text', 'varchar', 'date', 'datehour','price','phone','mail','password','url','select','checkbox', ...)
|
* @param int $type Type of attribute ('boolean', 'int', 'text', 'varchar', 'date', 'datehour','price','phone','mail','password','url','select','checkbox', ...)
|
||||||
* @param int $pos Position of attribute
|
* @param int $pos Position of attribute
|
||||||
* @param string $size Size/length of attribute
|
* @param string $size Size/length of attribute
|
||||||
* @param string $elementtype Element type ('member', 'product', 'thirdparty', ...)
|
* @param string $elementtype Element type ('member', 'product', 'thirdparty', ...)
|
||||||
* @param int $unique Is field unique or not
|
* @param int $unique Is field unique or not
|
||||||
* @param int $required Is field required or not
|
* @param int $required Is field required or not
|
||||||
* @param string $default_value Defaulted value (In database. use the default_value feature for default value on screen. Example: '', '0', 'null', 'avalue')
|
* @param string $default_value Defaulted value (In database. use the default_value feature for default value on screen. Example: '', '0', 'null', 'avalue')
|
||||||
* @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
|
* @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
|
||||||
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
||||||
* @param string $perms Permission to check
|
* @param string $perms Permission to check
|
||||||
* @param int $list Into list view by default
|
* @param int $list Into list view by default
|
||||||
* @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table)
|
* @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table)
|
||||||
* @param string $computed Computed value
|
* @param string $computed Computed value
|
||||||
* @param string $entity Entity of extrafields
|
* @param string $entity Entity of extrafields
|
||||||
|
* @param string $langfile Language file
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param=0, $alwayseditable=0, $perms='', $list=0, $ishidden=0, $computed='', $entity='')
|
function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param='', $alwayseditable=0, $perms='', $list=0, $ishidden=0, $computed='', $entity='', $langfile='')
|
||||||
{
|
{
|
||||||
if (empty($attrname)) return -1;
|
if (empty($attrname)) return -1;
|
||||||
if (empty($label)) return -1;
|
if (empty($label)) return -1;
|
||||||
@ -159,7 +163,7 @@ class ExtraFields
|
|||||||
if ($result > 0 || $err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' || $type == 'separate')
|
if ($result > 0 || $err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' || $type == 'separate')
|
||||||
{
|
{
|
||||||
// Add declaration of field into table
|
// Add declaration of field into table
|
||||||
$result2=$this->create_label($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $param, $alwayseditable, $perms, $list, $ishidden, $default, $computed, $entity);
|
$result2=$this->create_label($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $param, $alwayseditable, $perms, $list, $ishidden, $default, $computed, $entity, $langfile);
|
||||||
$err2=$this->errno;
|
$err2=$this->errno;
|
||||||
if ($result2 > 0 || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS'))
|
if ($result2 > 0 || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS'))
|
||||||
{
|
{
|
||||||
@ -271,7 +275,7 @@ class ExtraFields
|
|||||||
* @param string $elementtype Element type ('member', 'product', 'thirdparty', ...)
|
* @param string $elementtype Element type ('member', 'product', 'thirdparty', ...)
|
||||||
* @param int $unique Is field unique or not
|
* @param int $unique Is field unique or not
|
||||||
* @param int $required Is field required or not
|
* @param int $required Is field required or not
|
||||||
* @param array||string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
|
* @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
|
||||||
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
* @param int $alwayseditable Is attribute always editable regardless of the document status
|
||||||
* @param string $perms Permission to check
|
* @param string $perms Permission to check
|
||||||
* @param int $list Into list view by default
|
* @param int $list Into list view by default
|
||||||
@ -279,9 +283,10 @@ class ExtraFields
|
|||||||
* @param string $default Default value (in database. use the default_value feature for default value on screen).
|
* @param string $default Default value (in database. use the default_value feature for default value on screen).
|
||||||
* @param string $computed Computed value
|
* @param string $computed Computed value
|
||||||
* @param string $entity Entity of extrafields
|
* @param string $entity Entity of extrafields
|
||||||
|
* @param string $langfile Language file
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list=0, $ishidden=0, $default='', $computed='',$entity='')
|
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list=0, $ishidden=0, $default='', $computed='',$entity='', $langfile='')
|
||||||
{
|
{
|
||||||
global $conf,$user;
|
global $conf,$user;
|
||||||
|
|
||||||
@ -320,6 +325,7 @@ class ExtraFields
|
|||||||
$sql.= " param,";
|
$sql.= " param,";
|
||||||
$sql.= " alwayseditable,";
|
$sql.= " alwayseditable,";
|
||||||
$sql.= " perms,";
|
$sql.= " perms,";
|
||||||
|
$sql.= " langs,";
|
||||||
$sql.= " list,";
|
$sql.= " list,";
|
||||||
$sql.= " ishidden,";
|
$sql.= " ishidden,";
|
||||||
$sql.= " fielddefault,";
|
$sql.= " fielddefault,";
|
||||||
@ -340,6 +346,7 @@ class ExtraFields
|
|||||||
$sql.= " '".$params."',";
|
$sql.= " '".$params."',";
|
||||||
$sql.= " '".$alwayseditable."',";
|
$sql.= " '".$alwayseditable."',";
|
||||||
$sql.= " ".($perms?"'".$this->db->escape($perms)."'":"null").",";
|
$sql.= " ".($perms?"'".$this->db->escape($perms)."'":"null").",";
|
||||||
|
$sql.= " ".($langfile?"'".$this->db->escape($langfile)."'":"null").",";
|
||||||
$sql.= " ".$list.",";
|
$sql.= " ".$list.",";
|
||||||
$sql.= " ".$ishidden.",";
|
$sql.= " ".$ishidden.",";
|
||||||
$sql.= " ".($default?"'".$this->db->escape($default)."'":"null").",";
|
$sql.= " ".($default?"'".$this->db->escape($default)."'":"null").",";
|
||||||
@ -480,9 +487,10 @@ class ExtraFields
|
|||||||
* @param string $default Default value (in database. use the default_value feature for default value on screen).
|
* @param string $default Default value (in database. use the default_value feature for default value on screen).
|
||||||
* @param string $computed Computed value
|
* @param string $computed Computed value
|
||||||
* @param string $entity Entity of extrafields
|
* @param string $entity Entity of extrafields
|
||||||
|
* @param string $langfile Language file
|
||||||
* @return int >0 if OK, <=0 if KO
|
* @return int >0 if OK, <=0 if KO
|
||||||
*/
|
*/
|
||||||
function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0, $perms='',$list='',$ishidden=0,$default='',$computed='',$entity='')
|
function update($attrname, $label, $type, $length, $elementtype, $unique=0, $required=0, $pos=0, $param='', $alwayseditable=0, $perms='', $list='', $ishidden=0, $default='', $computed='', $entity='', $langfile='')
|
||||||
{
|
{
|
||||||
if ($elementtype == 'thirdparty') $elementtype='societe';
|
if ($elementtype == 'thirdparty') $elementtype='societe';
|
||||||
if ($elementtype == 'contact') $elementtype='socpeople';
|
if ($elementtype == 'contact') $elementtype='socpeople';
|
||||||
@ -530,7 +538,7 @@ class ExtraFields
|
|||||||
{
|
{
|
||||||
if ($label)
|
if ($label)
|
||||||
{
|
{
|
||||||
$result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param,$alwayseditable,$perms,$list,$ishidden,$default,$computed,$entity);
|
$result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param,$alwayseditable,$perms,$list,$ishidden,$default,$computed,$entity,$langfile);
|
||||||
}
|
}
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
@ -585,12 +593,13 @@ class ExtraFields
|
|||||||
* @param string $default Default value (in database. use the default_value feature for default value on screen).
|
* @param string $default Default value (in database. use the default_value feature for default value on screen).
|
||||||
* @param string $computed Computed value
|
* @param string $computed Computed value
|
||||||
* @param string $entity Entity of extrafields
|
* @param string $entity Entity of extrafields
|
||||||
|
* @param string $langfile Language file
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list=0,$ishidden=0,$default='',$computed='',$entity='')
|
private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list=0,$ishidden=0,$default='',$computed='',$entity='',$langfile='')
|
||||||
{
|
{
|
||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$ishidden.", ".$default.", ".$computed.", ".$entity);
|
dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$ishidden.", ".$default.", ".$computed.", ".$entity.", ".$langfile);
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if ($elementtype == 'thirdparty') $elementtype='societe';
|
if ($elementtype == 'thirdparty') $elementtype='societe';
|
||||||
@ -624,6 +633,7 @@ class ExtraFields
|
|||||||
$sql.= " fieldunique,";
|
$sql.= " fieldunique,";
|
||||||
$sql.= " fieldrequired,";
|
$sql.= " fieldrequired,";
|
||||||
$sql.= " perms,";
|
$sql.= " perms,";
|
||||||
|
$sql.= " langs,";
|
||||||
$sql.= " pos,";
|
$sql.= " pos,";
|
||||||
$sql.= " alwayseditable,";
|
$sql.= " alwayseditable,";
|
||||||
$sql.= " param,";
|
$sql.= " param,";
|
||||||
@ -644,6 +654,7 @@ class ExtraFields
|
|||||||
$sql.= " '".$unique."',";
|
$sql.= " '".$unique."',";
|
||||||
$sql.= " '".$required."',";
|
$sql.= " '".$required."',";
|
||||||
$sql.= " ".($perms?"'".$this->db->escape($perms)."'":"null").",";
|
$sql.= " ".($perms?"'".$this->db->escape($perms)."'":"null").",";
|
||||||
|
$sql.= " ".($langfile?"'".$this->db->escape($langfile)."'":"null").",";
|
||||||
$sql.= " '".$pos."',";
|
$sql.= " '".$pos."',";
|
||||||
$sql.= " '".$alwayseditable."',";
|
$sql.= " '".$alwayseditable."',";
|
||||||
$sql.= " '".$param."',";
|
$sql.= " '".$param."',";
|
||||||
@ -702,7 +713,7 @@ class ExtraFields
|
|||||||
// We should not have several time this log. If we have, there is some optimization to do by calling a simple $object->fetch_optionals() that include cache management.
|
// We should not have several time this log. If we have, there is some optimization to do by calling a simple $object->fetch_optionals() that include cache management.
|
||||||
dol_syslog("fetch_name_optionals_label elementtype=".$elementtype);
|
dol_syslog("fetch_name_optionals_label elementtype=".$elementtype);
|
||||||
|
|
||||||
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,list,ishidden,fielddefault,fieldcomputed";
|
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,ishidden,fielddefault,fieldcomputed";
|
||||||
$sql .= ",entity";
|
$sql .= ",entity";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."extrafields";
|
$sql.= " FROM ".MAIN_DB_PREFIX."extrafields";
|
||||||
$sql.= " WHERE entity IN (0,".$conf->entity.")";
|
$sql.= " WHERE entity IN (0,".$conf->entity.")";
|
||||||
@ -722,8 +733,6 @@ class ExtraFields
|
|||||||
$array_name_label[$tab->name]=$tab->label;
|
$array_name_label[$tab->name]=$tab->label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Old usage
|
// Old usage
|
||||||
$this->attribute_type[$tab->name]=$tab->type;
|
$this->attribute_type[$tab->name]=$tab->type;
|
||||||
$this->attribute_label[$tab->name]=$tab->label;
|
$this->attribute_label[$tab->name]=$tab->label;
|
||||||
@ -737,12 +746,11 @@ class ExtraFields
|
|||||||
$this->attribute_pos[$tab->name]=$tab->pos;
|
$this->attribute_pos[$tab->name]=$tab->pos;
|
||||||
$this->attribute_alwayseditable[$tab->name]=$tab->alwayseditable;
|
$this->attribute_alwayseditable[$tab->name]=$tab->alwayseditable;
|
||||||
$this->attribute_perms[$tab->name]=$tab->perms;
|
$this->attribute_perms[$tab->name]=$tab->perms;
|
||||||
|
$this->attribute_langfile[$tab->langs]=$tab->langs;
|
||||||
$this->attribute_list[$tab->name]=$tab->list;
|
$this->attribute_list[$tab->name]=$tab->list;
|
||||||
$this->attribute_hidden[$tab->name]=$tab->ishidden;
|
$this->attribute_hidden[$tab->name]=$tab->ishidden;
|
||||||
$this->attribute_entityid[$tab->name]=$tab->entity;
|
$this->attribute_entityid[$tab->name]=$tab->entity;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// New usage
|
// New usage
|
||||||
$this->attributes[$tab->elementtype]['type'][$tab->name]=$tab->type;
|
$this->attributes[$tab->elementtype]['type'][$tab->name]=$tab->type;
|
||||||
$this->attributes[$tab->elementtype]['label'][$tab->name]=$tab->label;
|
$this->attributes[$tab->elementtype]['label'][$tab->name]=$tab->label;
|
||||||
@ -756,6 +764,7 @@ class ExtraFields
|
|||||||
$this->attributes[$tab->elementtype]['pos'][$tab->name]=$tab->pos;
|
$this->attributes[$tab->elementtype]['pos'][$tab->name]=$tab->pos;
|
||||||
$this->attributes[$tab->elementtype]['alwayseditable'][$tab->name]=$tab->alwayseditable;
|
$this->attributes[$tab->elementtype]['alwayseditable'][$tab->name]=$tab->alwayseditable;
|
||||||
$this->attributes[$tab->elementtype]['perms'][$tab->name]=$tab->perms;
|
$this->attributes[$tab->elementtype]['perms'][$tab->name]=$tab->perms;
|
||||||
|
$this->attributes[$tab->elementtype]['langfile'][$tab->name]=$tab->langs;
|
||||||
$this->attributes[$tab->elementtype]['list'][$tab->name]=$tab->list;
|
$this->attributes[$tab->elementtype]['list'][$tab->name]=$tab->list;
|
||||||
$this->attributes[$tab->elementtype]['ishidden'][$tab->name]=$tab->ishidden;
|
$this->attributes[$tab->elementtype]['ishidden'][$tab->name]=$tab->ishidden;
|
||||||
$this->attributes[$tab->elementtype]['entityid'][$tab->name]=$tab->entity;
|
$this->attributes[$tab->elementtype]['entityid'][$tab->name]=$tab->entity;
|
||||||
@ -820,7 +829,7 @@ class ExtraFields
|
|||||||
$unique=$this->attribute_unique[$key];
|
$unique=$this->attribute_unique[$key];
|
||||||
$required=$this->attribute_required[$key];
|
$required=$this->attribute_required[$key];
|
||||||
$param=$this->attribute_param[$key];
|
$param=$this->attribute_param[$key];
|
||||||
$perms=$this->attribute_perms[$key];
|
$langfile=$this->attribute_langfile[$key];
|
||||||
$list=$this->attribute_list[$key];
|
$list=$this->attribute_list[$key];
|
||||||
$hidden=$this->attribute_hidden[$key];
|
$hidden=$this->attribute_hidden[$key];
|
||||||
|
|
||||||
@ -1352,6 +1361,7 @@ class ExtraFields
|
|||||||
$required=$this->attribute_required[$key];
|
$required=$this->attribute_required[$key];
|
||||||
$params=$this->attribute_param[$key];
|
$params=$this->attribute_param[$key];
|
||||||
$perms=$this->attribute_perms[$key];
|
$perms=$this->attribute_perms[$key];
|
||||||
|
$langfile=$this->attribute_langfile[$key];
|
||||||
$list=$this->attribute_list[$key];
|
$list=$this->attribute_list[$key];
|
||||||
$hidden=$this->attribute_hidden[$key]; // warning, do not rely on this. If your module need a hidden data, it must use its own table.
|
$hidden=$this->attribute_hidden[$key]; // warning, do not rely on this. If your module need a hidden data, it must use its own table.
|
||||||
|
|
||||||
|
|||||||
@ -3401,12 +3401,12 @@ class Form
|
|||||||
/**
|
/**
|
||||||
* Return list of categories having choosed type
|
* Return list of categories having choosed type
|
||||||
*
|
*
|
||||||
* @param int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated.
|
* @param string|int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated.
|
||||||
* @param string $selected Id of category preselected or 'auto' (autoselect category if there is only one element)
|
* @param string $selected Id of category preselected or 'auto' (autoselect category if there is only one element)
|
||||||
* @param string $htmlname HTML field name
|
* @param string $htmlname HTML field name
|
||||||
* @param int $maxlength Maximum length for labels
|
* @param int $maxlength Maximum length for labels
|
||||||
* @param int $excludeafterid Exclude all categories after this leaf in category tree.
|
* @param int $excludeafterid Exclude all categories after this leaf in category tree.
|
||||||
* @param int $outputmode 0=HTML select string, 1=Array
|
* @param int $outputmode 0=HTML select string, 1=Array
|
||||||
* @return string
|
* @return string
|
||||||
* @see select_categories
|
* @see select_categories
|
||||||
*/
|
*/
|
||||||
@ -3449,7 +3449,7 @@ class Form
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$cat = new Categorie($this->db);
|
$cat = new Categorie($this->db);
|
||||||
$cate_arbo = $cat->get_full_arbo($type,$excludeafterid);
|
$cate_arbo = $cat->get_full_arbo($type, $excludeafterid);
|
||||||
}
|
}
|
||||||
|
|
||||||
$output = '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
|
$output = '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||||
|
|||||||
@ -455,7 +455,21 @@ class SMTPs
|
|||||||
$this->_setErr(131, 'STARTTLS connection is not supported.');
|
$this->_setErr(131, 'STARTTLS connection is not supported.');
|
||||||
return $_retVal;
|
return $_retVal;
|
||||||
}
|
}
|
||||||
if (!stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT))
|
|
||||||
|
// Before 5.6.7:
|
||||||
|
// STREAM_CRYPTO_METHOD_SSLv23_CLIENT = STREAM_CRYPTO_METHOD_SSLv2_CLIENT|STREAM_CRYPTO_METHOD_SSLv3_CLIENT
|
||||||
|
// STREAM_CRYPTO_METHOD_TLS_CLIENT = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
|
||||||
|
// PHP >= 5.6.7:
|
||||||
|
// STREAM_CRYPTO_METHOD_SSLv23_CLIENT = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
|
||||||
|
// STREAM_CRYPTO_METHOD_TLS_CLIENT = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT
|
||||||
|
|
||||||
|
$crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
|
||||||
|
if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
|
||||||
|
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
|
||||||
|
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!stream_socket_enable_crypto($this->socket, true, $crypto_method))
|
||||||
{
|
{
|
||||||
$this->_setErr(132, 'STARTTLS connection failed.');
|
$this->_setErr(132, 'STARTTLS connection failed.');
|
||||||
return $_retVal;
|
return $_retVal;
|
||||||
|
|||||||
@ -5889,6 +5889,7 @@ function picto_from_langcode($codelang)
|
|||||||
* 'supplier_invoice' to add a tab in supplier invoice view
|
* 'supplier_invoice' to add a tab in supplier invoice view
|
||||||
* 'invoice' to add a tab in customer invoice view
|
* 'invoice' to add a tab in customer invoice view
|
||||||
* 'order' to add a tab in customer order view
|
* 'order' to add a tab in customer order view
|
||||||
|
* 'contract' to add a tabl in contract view
|
||||||
* 'product' to add a tab in product view
|
* 'product' to add a tab in product view
|
||||||
* 'propal' to add a tab in propal view
|
* 'propal' to add a tab in propal view
|
||||||
* 'user' to add a tab in user view
|
* 'user' to add a tab in user view
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2008-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -201,11 +201,19 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
|||||||
$demopassword=$tab[1];
|
$demopassword=$tab[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute hook getLoginPageOptions
|
// Execute hook getLoginPageOptions (for table)
|
||||||
// Should be an array with differents options in $hookmanager->resArray
|
|
||||||
$parameters=array('entity' => GETPOST('entity','int'));
|
$parameters=array('entity' => GETPOST('entity','int'));
|
||||||
$reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. resArray is filled by hook.
|
$reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks.
|
||||||
$morelogincontent = $hookmanager->resArray['options']; // TODO Use here a resprints
|
if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) {
|
||||||
|
$morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility
|
||||||
|
} else {
|
||||||
|
$morelogincontent = $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute hook getLoginPageExtraOptions (eg for js)
|
||||||
|
$parameters=array('entity' => GETPOST('entity','int'));
|
||||||
|
$reshook = $hookmanager->executeHooks('getLoginPageExtraOptions',$parameters); // Note that $action and $object may have been modified by some hooks.
|
||||||
|
$moreloginextracontent = $hookmanager->resPrint;
|
||||||
|
|
||||||
// Login
|
// Login
|
||||||
$login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin));
|
$login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin));
|
||||||
|
|||||||
@ -1486,7 +1486,18 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG);
|
dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG);
|
||||||
$this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
if (! $resql)
|
||||||
|
{
|
||||||
|
dol_syslog($this->db->lasterror(), LOG_ERR);
|
||||||
|
if ($this->db->lasterrno() != 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||||
|
{
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
$this->errors[] = $this->db->lasterror();
|
||||||
|
$err++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2010-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
*
|
*
|
||||||
@ -158,7 +158,9 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- Position -->
|
<!-- Position -->
|
||||||
<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo GETPOST('pos'); ?>"></td></tr>
|
<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo GETPOST('pos','int'); ?>"></td></tr>
|
||||||
|
<!-- Language file -->
|
||||||
|
<tr><td class="titlefield"><?php echo $langs->trans("LanguageFile"); ?></td><td class="valeur"><input type="text" name="langfile" class="minwidth200" value="<?php echo dol_escape_htmltag(GETPOST('langfile','alpha')); ?>"></td></tr>
|
||||||
<!-- Computed Value -->
|
<!-- Computed Value -->
|
||||||
<tr class="extra_computed_value"><td><?php echo $form->textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?></td><td class="valeur"><input id="computed_value" type="text" name="computed_value" class="quatrevingtpercent" value="<?php echo (GETPOST('"computed_value"')?GETPOST('"computed_value"'):''); ?>"></td></tr>
|
<tr class="extra_computed_value"><td><?php echo $form->textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?></td><td class="valeur"><input id="computed_value" type="text" name="computed_value" class="quatrevingtpercent" value="<?php echo (GETPOST('"computed_value"')?GETPOST('"computed_value"'):''); ?>"></td></tr>
|
||||||
<!-- Default Value (at sql setup level) -->
|
<!-- Default Value (at sql setup level) -->
|
||||||
|
|||||||
@ -129,23 +129,20 @@
|
|||||||
<table summary="listofattributes" class="border centpercent">
|
<table summary="listofattributes" class="border centpercent">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$type=$extrafields->attribute_type[$attrname];
|
$type=$extrafields->attributes[$elementtype]['type'][$attrname];
|
||||||
$size=$extrafields->attribute_size[$attrname];
|
$size=$extrafields->attributes[$elementtype]['size'][$attrname];
|
||||||
$computed=$extrafields->attribute_computed[$attrname];
|
$computed=$extrafields->attributes[$elementtype]['computed'][$attrname];
|
||||||
$default=$extrafields->attribute_default[$attrname];
|
$default=$extrafields->attributes[$elementtype]['default'][$attrname];
|
||||||
$unique=$extrafields->attribute_unique[$attrname];
|
$unique=$extrafields->attributes[$elementtype]['unique'][$attrname];
|
||||||
$required=$extrafields->attribute_required[$attrname];
|
$required=$extrafields->attributes[$elementtype]['required'][$attrname];
|
||||||
$pos=$extrafields->attribute_pos[$attrname];
|
$pos=$extrafields->attributes[$elementtype]['pos'][$attrname];
|
||||||
$alwayseditable=$extrafields->attribute_alwayseditable[$attrname];
|
$alwayseditable=$extrafields->attributes[$elementtype]['alwayseditable'][$attrname];
|
||||||
$param=$extrafields->attribute_param[$attrname];
|
$param=$extrafields->attributes[$elementtype]['param'][$attrname];
|
||||||
$perms=$extrafields->attribute_perms[$attrname];
|
$perms=$extrafields->attributes[$elementtype]['perms'][$attrname];
|
||||||
$list=$extrafields->attribute_list[$attrname];
|
$langfile=$extrafields->attributes[$elementtype]['langfile'][$attrname];
|
||||||
if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) {
|
$list=$extrafields->attributes[$elementtype]['list'][$attrname];
|
||||||
$ishidden=$extrafields->attribute_hidden[$attrname];
|
$ishidden=$extrafields->attributes[$elementtype]['hidden'][$attrname];
|
||||||
}
|
$entitycurrentorall=$extrafields->attributes[$elementtype]['entityid'][$attrname];
|
||||||
if ($conf->multicompany->enabled) {
|
|
||||||
$entitycurrentorall=$extrafields->attribute_entityid[$attrname];
|
|
||||||
}
|
|
||||||
|
|
||||||
if((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param))
|
if((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param))
|
||||||
{
|
{
|
||||||
@ -220,7 +217,9 @@ else
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- Position -->
|
<!-- Position -->
|
||||||
<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo dol_escape_htmltag($extrafields->attribute_pos[$attrname]); ?>"></td></tr>
|
<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo dol_escape_htmltag($pos); ?>"></td></tr>
|
||||||
|
<!-- Language file -->
|
||||||
|
<tr><td class="titlefield"><?php echo $langs->trans("LanguageFile"); ?></td><td class="valeur"><input type="text" name="langfile" class="minwidth200" value="<?php echo dol_escape_htmltag($langfile); ?>"></td></tr>
|
||||||
<!-- Computed value -->
|
<!-- Computed value -->
|
||||||
<tr class="extra_computed_value"><td><?php echo $form->textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?></td><td class="valeur"><input id="computed_value" class="quatrevingtpercent" type="text" name="computed_value" value="<?php echo dol_escape_htmltag($computed); ?>"></td></tr>
|
<tr class="extra_computed_value"><td><?php echo $form->textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?></td><td class="valeur"><input id="computed_value" class="quatrevingtpercent" type="text" name="computed_value" value="<?php echo dol_escape_htmltag($computed); ?>"></td></tr>
|
||||||
<!-- Default value -->
|
<!-- Default value -->
|
||||||
|
|||||||
@ -37,10 +37,14 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object,
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
|
//var_dump($extrafields->attributes);
|
||||||
if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element]['label']))
|
if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element]['label']))
|
||||||
{
|
{
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label)
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label)
|
||||||
{
|
{
|
||||||
|
// Load language if required
|
||||||
|
if (! empty($extrafields->attributes[$object->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$key]);
|
||||||
|
|
||||||
if ($action == 'edit_extras')
|
if ($action == 'edit_extras')
|
||||||
{
|
{
|
||||||
$value = (isset($_POST["options_" . $key]) ? $_POST["options_" . $key] : $object->array_options["options_" . $key]);
|
$value = (isset($_POST["options_" . $key]) ? $_POST["options_" . $key] : $object->array_options["options_" . $key]);
|
||||||
|
|||||||
@ -49,7 +49,7 @@ print top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 0, $disable
|
|||||||
?>
|
?>
|
||||||
<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->
|
<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->
|
||||||
|
|
||||||
<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
|
<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
|
||||||
|
|
||||||
<?php if (empty($conf->dol_use_jmobile)) { ?>
|
<?php if (empty($conf->dol_use_jmobile)) { ?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -123,23 +123,28 @@ if ($disablenofollow) echo '</a>';
|
|||||||
</span>
|
</span>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<?php
|
<?php
|
||||||
if (! empty($morelogincontent) && is_array($morelogincontent)) {
|
if (! empty($morelogincontent)) {
|
||||||
foreach ($morelogincontent as $format => $option)
|
if (is_array($morelogincontent)) {
|
||||||
{
|
foreach ($morelogincontent as $format => $option)
|
||||||
if ($format == 'table') {
|
{
|
||||||
echo '<!-- Option by hook -->';
|
if ($format == 'table') {
|
||||||
echo $option;
|
echo '<!-- Option by hook -->';
|
||||||
|
echo $option;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
echo '<!-- Option by hook -->';
|
||||||
|
echo $morelogincontent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
<?php
|
if ($captcha) {
|
||||||
if ($captcha) {
|
// Add a variable param to force not using cache (jmobile)
|
||||||
// Add a variable param to force not using cache (jmobile)
|
$php_self = preg_replace('/[&\?]time=(\d+)/','',$php_self); // Remove param time
|
||||||
$php_self = preg_replace('/[&\?]time=(\d+)/','',$php_self); // Remove param time
|
if (preg_match('/\?/',$php_self)) $php_self.='&time='.dol_print_date(dol_now(),'dayhourlog');
|
||||||
if (preg_match('/\?/',$php_self)) $php_self.='&time='.dol_print_date(dol_now(),'dayhourlog');
|
else $php_self.='?time='.dol_print_date(dol_now(),'dayhourlog');
|
||||||
else $php_self.='?time='.dol_print_date(dol_now(),'dayhourlog');
|
// TODO: provide accessible captcha variants
|
||||||
// TODO: provide accessible captcha variants
|
|
||||||
?>
|
?>
|
||||||
<!-- Captcha -->
|
<!-- Captcha -->
|
||||||
<tr>
|
<tr>
|
||||||
@ -275,9 +280,9 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) {
|
|||||||
|
|
||||||
<!-- Common footer is not used for login page, this is same than footer but inside login tpl -->
|
<!-- Common footer is not used for login page, this is same than footer but inside login tpl -->
|
||||||
|
|
||||||
<?php if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; ?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER;
|
||||||
|
|
||||||
if (! empty($morelogincontent) && is_array($morelogincontent)) {
|
if (! empty($morelogincontent) && is_array($morelogincontent)) {
|
||||||
foreach ($morelogincontent as $format => $option)
|
foreach ($morelogincontent as $format => $option)
|
||||||
{
|
{
|
||||||
@ -287,9 +292,11 @@ if (! empty($morelogincontent) && is_array($morelogincontent)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
else if (! empty($moreloginextracontent)) {
|
||||||
|
echo '<!-- Javascript by hook -->';
|
||||||
|
echo $moreloginextracontent;
|
||||||
|
}
|
||||||
|
|
||||||
<?php
|
|
||||||
// Google Analytics (need Google module)
|
// Google Analytics (need Google module)
|
||||||
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID))
|
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID))
|
||||||
{
|
{
|
||||||
@ -309,9 +316,7 @@ if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID)
|
|||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
// Google Adsense
|
// Google Adsense
|
||||||
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT))
|
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -35,7 +35,7 @@ print top_htmlhead('',$langs->trans('SendNewPassword'));
|
|||||||
?>
|
?>
|
||||||
<!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->
|
<!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->
|
||||||
|
|
||||||
<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
|
<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
|
||||||
|
|
||||||
<?php if (empty($conf->dol_use_jmobile)) { ?>
|
<?php if (empty($conf->dol_use_jmobile)) { ?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -88,14 +88,20 @@ if ($disablenofollow) echo '</a>';
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (! empty($hookmanager->resArray['options'])) {
|
if (! empty($morelogincontent)) {
|
||||||
foreach ($hookmanager->resArray['options'] as $format => $option)
|
if (is_array($morelogincontent)) {
|
||||||
{
|
foreach ($morelogincontent as $format => $option)
|
||||||
if ($format == 'table') {
|
{
|
||||||
echo '<!-- Option by hook -->';
|
if ($format == 'table') {
|
||||||
echo $option;
|
echo '<!-- Option by hook -->';
|
||||||
|
echo $option;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
echo '<!-- Option by hook -->';
|
||||||
|
echo $morelogincontent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@ -175,6 +181,20 @@ if (! empty($hookmanager->resArray['options'])) {
|
|||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
<?php if (! empty($morelogincontent) && is_array($morelogincontent)) {
|
||||||
|
foreach ($morelogincontent as $format => $option)
|
||||||
|
{
|
||||||
|
if ($format == 'js') {
|
||||||
|
echo "\n".'<!-- Javascript by hook -->';
|
||||||
|
echo $option."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (! empty($moreloginextracontent)) {
|
||||||
|
echo '<!-- Javascript by hook -->';
|
||||||
|
echo $moreloginextracontent;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div> <!-- end of center -->
|
</div> <!-- end of center -->
|
||||||
|
|||||||
@ -268,11 +268,13 @@ $filepath=$relativepath.$file->label;
|
|||||||
$rellink.='&file='.urlencode($filepath);
|
$rellink.='&file='.urlencode($filepath);
|
||||||
$fulllink=$urlwithroot.$rellink;
|
$fulllink=$urlwithroot.$rellink;
|
||||||
print img_picto('','object_globe.png').' ';
|
print img_picto('','object_globe.png').' ';
|
||||||
print '<input type="text" class="quatrevingtpercent" name="downloadlink" value="'.dol_escape_htmltag($fulllink).'">';
|
print '<input type="text" class="quatrevingtpercent" id="downloadlink" name="downloadlink" value="'.dol_escape_htmltag($fulllink).'">';
|
||||||
print ' <a data-ajax="false" href="'.$fulllink.'">'.$langs->trans("Download").'</a>';
|
print ' <a href="'.$fulllink.'">'.$langs->trans("Download").'</a>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
print ajax_autoselect('downloadlink');
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
if ($_GET["action"] == 'edit')
|
if ($_GET["action"] == 'edit')
|
||||||
|
|||||||
@ -820,7 +820,6 @@ if (empty($action))
|
|||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
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="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
|||||||
@ -25,6 +25,11 @@
|
|||||||
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE llx_mailing MODIFY COLUMN titre varchar(128);
|
||||||
|
ALTER TABLE llx_mailing MODIFY COLUMN sujet varchar(128);
|
||||||
|
|
||||||
|
ALTER TABLE llx_mailing MODIFY COLUMN langs varchar(64);
|
||||||
|
|
||||||
ALTER TABLE llx_facture_fourn ADD COLUMN date_pointoftax date DEFAULT NULL;
|
ALTER TABLE llx_facture_fourn ADD COLUMN date_pointoftax date DEFAULT NULL;
|
||||||
ALTER TABLE llx_facture_fourn ADD COLUMN date_valid date;
|
ALTER TABLE llx_facture_fourn ADD COLUMN date_valid date;
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@ create table llx_extrafields
|
|||||||
alwayseditable integer DEFAULT 0, -- 1 if field can be edited whatever is element status
|
alwayseditable integer DEFAULT 0, -- 1 if field can be edited whatever is element status
|
||||||
param text, -- extra parameters to define possible values of field
|
param text, -- extra parameters to define possible values of field
|
||||||
list integer DEFAULT 0, -- list of values for field that are combo lists
|
list integer DEFAULT 0, -- list of values for field that are combo lists
|
||||||
langs varchar(24), -- example: fileofmymodule@mymodule
|
langs varchar(64), -- example: fileofmymodule@mymodule
|
||||||
ishidden integer DEFAULT 0, -- Can be foreign key of external system
|
ishidden integer DEFAULT 0, -- Can be foreign key of external system
|
||||||
fk_user_author integer, -- user making creation
|
fk_user_author integer, -- user making creation
|
||||||
fk_user_modif integer, -- user making last change
|
fk_user_modif integer, -- user making last change
|
||||||
|
|||||||
@ -27,9 +27,9 @@ create table llx_mailing
|
|||||||
(
|
(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
statut smallint DEFAULT 0, --
|
statut smallint DEFAULT 0, --
|
||||||
titre varchar(60), -- Ref of mailing
|
titre varchar(128), -- Ref of mailing
|
||||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||||
sujet varchar(60), -- Sujet of mailing
|
sujet varchar(128), -- Sujet of mailing
|
||||||
body mediumtext,
|
body mediumtext,
|
||||||
bgcolor varchar(8), -- Backgroud color of mailing
|
bgcolor varchar(8), -- Backgroud color of mailing
|
||||||
bgimage varchar(255), -- Backgroud image of mailing
|
bgimage varchar(255), -- Backgroud image of mailing
|
||||||
|
|||||||
@ -345,6 +345,7 @@ AddCRIfTooLong=There is no automatic wrapping, so if line is out of page on docu
|
|||||||
ConfirmPurge=Are you sure you want to execute this purge?<br>This will delete definitely all your data files with no way to restore them (ECM files, attached files...).
|
ConfirmPurge=Are you sure you want to execute this purge?<br>This will delete definitely all your data files with no way to restore them (ECM files, attached files...).
|
||||||
MinLength=Minimum length
|
MinLength=Minimum length
|
||||||
LanguageFilesCachedIntoShmopSharedMemory=Files .lang loaded in shared memory
|
LanguageFilesCachedIntoShmopSharedMemory=Files .lang loaded in shared memory
|
||||||
|
LanguageFile=Language file
|
||||||
ExamplesWithCurrentSetup=Examples with current running setup
|
ExamplesWithCurrentSetup=Examples with current running setup
|
||||||
ListOfDirectories=List of OpenDocument templates directories
|
ListOfDirectories=List of OpenDocument templates directories
|
||||||
ListOfDirectoriesForModelGenODT=List of directories containing templates files with OpenDocument format.<br><br>Put here full path of directories.<br>Add a carriage return between eah directory.<br>To add a directory of the GED module, add here <b>DOL_DATA_ROOT/ecm/yourdirectoryname</b>.<br><br>Files in those directories must end with <b>.odt</b> or <b>.ods</b>.
|
ListOfDirectoriesForModelGenODT=List of directories containing templates files with OpenDocument format.<br><br>Put here full path of directories.<br>Add a carriage return between eah directory.<br>To add a directory of the GED module, add here <b>DOL_DATA_ROOT/ecm/yourdirectoryname</b>.<br><br>Files in those directories must end with <b>.odt</b> or <b>.ods</b>.
|
||||||
|
|||||||
@ -35,6 +35,9 @@ ClassFile=File for PHP DAO CRUD class
|
|||||||
ApiClassFile=File for PHP API class
|
ApiClassFile=File for PHP API class
|
||||||
PageForList=PHP page for list of record
|
PageForList=PHP page for list of record
|
||||||
PageForCreateEditView=PHP page to create/edit/view a record
|
PageForCreateEditView=PHP page to create/edit/view a record
|
||||||
|
PageForAgendaTab=PHP page for event tab
|
||||||
|
PageForDocumentTab=PHP page for document tab
|
||||||
|
PageForNoteTab=PHP page for note tab
|
||||||
PathToModulePackage=Path to zip of module/application package
|
PathToModulePackage=Path to zip of module/application package
|
||||||
PathToModuleDocumentation=Path to file of module/application documentation
|
PathToModuleDocumentation=Path to file of module/application documentation
|
||||||
SpaceOrSpecialCharAreNotAllowed=Spaces or special characters are not allowed.
|
SpaceOrSpecialCharAreNotAllowed=Spaces or special characters are not allowed.
|
||||||
|
|||||||
@ -71,7 +71,7 @@ MaxSize=Maximum size
|
|||||||
AttachANewFile=Attach a new file/document
|
AttachANewFile=Attach a new file/document
|
||||||
LinkedObject=Linked object
|
LinkedObject=Linked object
|
||||||
NbOfActiveNotifications=Number of notifications (nb of recipient emails)
|
NbOfActiveNotifications=Number of notifications (nb of recipient emails)
|
||||||
PredefinedMailTest=This is a test mail.\nThe two lines are separated by a carriage return.\n\n__SIGNATURE__
|
PredefinedMailTest=This is a test mail sent to __EMAIL__.\nThe two lines are separated by a carriage return.\n\n__SIGNATURE__
|
||||||
PredefinedMailTestHtml=This is a <b>test</b> mail (the word test must be in bold).<br>The two lines are separated by a carriage return.<br><br>__SIGNATURE__
|
PredefinedMailTestHtml=This is a <b>test</b> mail (the word test must be in bold).<br>The two lines are separated by a carriage return.<br><br>__SIGNATURE__
|
||||||
PredefinedMailContentSendInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
PredefinedMailContentSendInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
||||||
PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__\n\nWe would like to warn you that the invoice __REF__ seems to not being payed. So this is the invoice in attachment again, as a reminder.\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__\n\nWe would like to warn you that the invoice __REF__ seems to not being payed. So this is the invoice in attachment again, as a reminder.\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
||||||
|
|||||||
@ -411,7 +411,7 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname)
|
|||||||
$filetogenerate = array(
|
$filetogenerate = array(
|
||||||
'myobject_card.php'=>strtolower($objectname).'_card.php',
|
'myobject_card.php'=>strtolower($objectname).'_card.php',
|
||||||
'myobject_note.php'=>strtolower($objectname).'_note.php',
|
'myobject_note.php'=>strtolower($objectname).'_note.php',
|
||||||
'myobject_document.php'=>strtolower($objectname).'_note.php',
|
'myobject_document.php'=>strtolower($objectname).'_document.php',
|
||||||
'myobject_agenda.php'=>strtolower($objectname).'_agenda.php',
|
'myobject_agenda.php'=>strtolower($objectname).'_agenda.php',
|
||||||
'myobject_list.php'=>strtolower($objectname).'_list.php',
|
'myobject_list.php'=>strtolower($objectname).'_list.php',
|
||||||
'lib/myobject.lib.php'=>'lib/'.strtolower($objectname).'.lib.php',
|
'lib/myobject.lib.php'=>'lib/'.strtolower($objectname).'.lib.php',
|
||||||
@ -1227,6 +1227,7 @@ elseif (! empty($module))
|
|||||||
foreach($listofobject as $fileobj)
|
foreach($listofobject as $fileobj)
|
||||||
{
|
{
|
||||||
if (preg_match('/^api_/',$fileobj['name'])) continue;
|
if (preg_match('/^api_/',$fileobj['name'])) continue;
|
||||||
|
if (preg_match('/^actions_/',$fileobj['name'])) continue;
|
||||||
|
|
||||||
$tmpcontent=file_get_contents($fileobj['fullname']);
|
$tmpcontent=file_get_contents($fileobj['fullname']);
|
||||||
if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims',$tmpcontent,$reg))
|
if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims',$tmpcontent,$reg))
|
||||||
@ -1236,7 +1237,7 @@ elseif (! empty($module))
|
|||||||
if (empty($firstobjectname)) $firstobjectname = $objectname;
|
if (empty($firstobjectname)) $firstobjectname = $objectname;
|
||||||
}
|
}
|
||||||
|
|
||||||
$head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'').'&tabobj='.$objectname;
|
$head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'').'&tabobj='.$objectname;
|
||||||
$head3[$h][1] = $objectname;
|
$head3[$h][1] = $objectname;
|
||||||
$head3[$h][2] = $objectname;
|
$head3[$h][2] = $objectname;
|
||||||
$h++;
|
$h++;
|
||||||
@ -1302,14 +1303,17 @@ elseif (! empty($module))
|
|||||||
if ($action != 'editfile' || empty($file))
|
if ($action != 'editfile' || empty($file))
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$pathtoclass = strtolower($module).'/class/'.strtolower($tabobj).'.class.php';
|
$pathtoclass = strtolower($module).'/class/'.strtolower($tabobj).'.class.php';
|
||||||
$pathtoapi = strtolower($module).'/class/api_'.strtolower($tabobj).'.class.php';
|
$pathtoapi = strtolower($module).'/class/api_'.strtolower($tabobj).'.class.php';
|
||||||
$pathtolist = strtolower($module).'/'.strtolower($tabobj).'_list.php';
|
$pathtoagenda = strtolower($module).'/'.strtolower($tabobj).'_agenda.php';
|
||||||
$pathtocard = strtolower($module).'/'.strtolower($tabobj).'_card.php';
|
$pathtocard = strtolower($module).'/'.strtolower($tabobj).'_card.php';
|
||||||
$pathtophpunit = strtolower($module).'/test/phpunit/'.$tabobj.'Test.php';
|
$pathtodocument = strtolower($module).'/'.strtolower($tabobj).'_document.php';
|
||||||
$pathtosql = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.sql';
|
$pathtolist = strtolower($module).'/'.strtolower($tabobj).'_list.php';
|
||||||
|
$pathtonote = strtolower($module).'/'.strtolower($tabobj).'_note.php';
|
||||||
|
$pathtophpunit = strtolower($module).'/test/phpunit/'.$tabobj.'Test.php';
|
||||||
|
$pathtosql = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.sql';
|
||||||
$pathtosqlextra = strtolower($module).'/sql/llx_'.strtolower($tabobj).'_extrafields.sql';
|
$pathtosqlextra = strtolower($module).'/sql/llx_'.strtolower($tabobj).'_extrafields.sql';
|
||||||
$pathtosqlkey = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.key.sql';
|
$pathtosqlkey = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.key.sql';
|
||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<span class="fa fa-file"></span> '.$langs->trans("ClassFile").' : <strong>'.$pathtoclass.'</strong>';
|
print '<span class="fa fa-file"></span> '.$langs->trans("ClassFile").' : <strong>'.$pathtoclass.'</strong>';
|
||||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtoclass).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtoclass).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
@ -1335,6 +1339,15 @@ elseif (! empty($module))
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
print '<span class="fa fa-file"></span> '.$langs->trans("PageForCreateEditView").' : <strong>'.$pathtocard.'</strong>';
|
print '<span class="fa fa-file"></span> '.$langs->trans("PageForCreateEditView").' : <strong>'.$pathtocard.'</strong>';
|
||||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtocard).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtocard).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
|
print '<br>';
|
||||||
|
print '<span class="fa fa-file"></span> '.$langs->trans("PageForAgendaTab").' : <strong>'.$pathtoagenda.'</strong>';
|
||||||
|
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtoagenda).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
|
print '<br>';
|
||||||
|
print '<span class="fa fa-file"></span> '.$langs->trans("PageForDocumentTab").' : <strong>'.$pathtodocument.'</strong>';
|
||||||
|
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtodocument).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
|
print '<br>';
|
||||||
|
print '<span class="fa fa-file"></span> '.$langs->trans("PageForNoteTab").' : <strong>'.$pathtonote.'</strong>';
|
||||||
|
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtonote).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '<br><br><br>';
|
print '<br><br><br>';
|
||||||
@ -1708,51 +1721,58 @@ elseif (! empty($module))
|
|||||||
print_liste_field_titre("Comment",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
|
print_liste_field_titre("Comment",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
foreach ($cronjobs as $cron)
|
if (count($cronjobs))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven">';
|
foreach ($cronjobs as $cron)
|
||||||
|
{
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $cron['label'];
|
print $cron['label'];
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($cron['jobtype']=='method')
|
if ($cron['jobtype']=='method')
|
||||||
{
|
{
|
||||||
$text=$langs->trans("CronClass");
|
$text=$langs->trans("CronClass");
|
||||||
$texttoshow=$langs->trans('CronModule').': '.$module.'<br>';
|
$texttoshow=$langs->trans('CronModule').': '.$module.'<br>';
|
||||||
$texttoshow.=$langs->trans('CronClass').': '. $cron['class'].'<br>';
|
$texttoshow.=$langs->trans('CronClass').': '. $cron['class'].'<br>';
|
||||||
$texttoshow.=$langs->trans('CronObject').': '. $cron['objectname'].'<br>';
|
$texttoshow.=$langs->trans('CronObject').': '. $cron['objectname'].'<br>';
|
||||||
$texttoshow.=$langs->trans('CronMethod').': '. $cron['method'];
|
$texttoshow.=$langs->trans('CronMethod').': '. $cron['method'];
|
||||||
$texttoshow.='<br>'.$langs->trans('CronArgs').': '. $cron['parameters'];
|
$texttoshow.='<br>'.$langs->trans('CronArgs').': '. $cron['parameters'];
|
||||||
$texttoshow.='<br>'.$langs->trans('Comment').': '. $langs->trans($cron['comment']);
|
$texttoshow.='<br>'.$langs->trans('Comment').': '. $langs->trans($cron['comment']);
|
||||||
}
|
}
|
||||||
elseif ($cron['jobtype']=='command')
|
elseif ($cron['jobtype']=='command')
|
||||||
{
|
{
|
||||||
$text=$langs->trans('CronCommand');
|
$text=$langs->trans('CronCommand');
|
||||||
$texttoshow=$langs->trans('CronCommand').': '.dol_trunc($cron['command']);
|
$texttoshow=$langs->trans('CronCommand').': '.dol_trunc($cron['command']);
|
||||||
$texttoshow.='<br>'.$langs->trans('CronArgs').': '. $cron['parameters'];
|
$texttoshow.='<br>'.$langs->trans('CronArgs').': '. $cron['parameters'];
|
||||||
$texttoshow.='<br>'.$langs->trans('Comment').': '. $langs->trans($cron['comment']);
|
$texttoshow.='<br>'.$langs->trans('Comment').': '. $langs->trans($cron['comment']);
|
||||||
}
|
}
|
||||||
print $form->textwithpicto($text, $texttoshow, 1);
|
print $form->textwithpicto($text, $texttoshow, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if($cron['unitfrequency'] == "60") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Minutes');
|
if($cron['unitfrequency'] == "60") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Minutes');
|
||||||
if($cron['unitfrequency'] == "3600") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Hours');
|
if($cron['unitfrequency'] == "3600") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Hours');
|
||||||
if($cron['unitfrequency'] == "86400") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Days');
|
if($cron['unitfrequency'] == "86400") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Days');
|
||||||
if($cron['unitfrequency'] == "604800") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Weeks');
|
if($cron['unitfrequency'] == "604800") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Weeks');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $cron['status'];
|
print $cron['status'];
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (!empty($cron['comment'])) {print $cron['comment'];}
|
if (!empty($cron['comment'])) {print $cron['comment'];}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<tr><td class="opacitymedium" colspan="5">'.$langs->trans("None").'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -125,13 +125,22 @@ class modMyModule extends DolibarrModules
|
|||||||
1=>array('MYMODULE_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1)
|
1=>array('MYMODULE_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
if (! isset($conf->mymodule) || ! isset($conf->mymodule->enabled))
|
||||||
|
{
|
||||||
|
$conf->mymodule=new stdClass();
|
||||||
|
$conf->mymodule->enabled=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Array to add new pages in new tabs
|
// Array to add new pages in new tabs
|
||||||
// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
|
$this->tabs = array();
|
||||||
// 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
|
// Example:
|
||||||
// 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
|
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
|
||||||
// Can also be: $this->tabs = array('data'=>'...', 'entity'=>0);
|
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
|
||||||
|
// $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
|
||||||
//
|
//
|
||||||
// where objecttype can be
|
// Where objecttype can be
|
||||||
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
|
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
|
||||||
// 'contact' to add a tab in contact view
|
// 'contact' to add a tab in contact view
|
||||||
// 'contract' to add a tab in contract view
|
// 'contract' to add a tab in contract view
|
||||||
@ -151,13 +160,7 @@ class modMyModule extends DolibarrModules
|
|||||||
// 'stock' to add a tab in stock view
|
// 'stock' to add a tab in stock view
|
||||||
// 'thirdparty' to add a tab in third party view
|
// 'thirdparty' to add a tab in third party view
|
||||||
// 'user' to add a tab in user view
|
// 'user' to add a tab in user view
|
||||||
$this->tabs = array();
|
|
||||||
|
|
||||||
if (! isset($conf->mymodule) || ! isset($conf->mymodule->enabled))
|
|
||||||
{
|
|
||||||
$conf->mymodule=new stdClass();
|
|
||||||
$conf->mymodule->enabled=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dictionaries
|
// Dictionaries
|
||||||
$this->dictionaries=array();
|
$this->dictionaries=array();
|
||||||
@ -311,11 +314,11 @@ class modMyModule extends DolibarrModules
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
|
|
||||||
$result1=$extrafields->addExtraField('myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty');
|
//$result1=$extrafields->addExtraField('myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'mymodule@mymodule');
|
||||||
//$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project');
|
//$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'mymodule@mymodule');
|
||||||
//$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account');
|
//$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'mymodule@mymodule');
|
||||||
//$result4=$extrafields->addExtraField('myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1);
|
//$result4=$extrafields->addExtraField('myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1);
|
||||||
//$result5=$extrafields->addExtraField('myattr5', "New Attr 5 label", 'text', 1, 10, 'user');
|
//$result5=$extrafields->addExtraField('myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'mymodule@mymodule');
|
||||||
|
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
|
|||||||
@ -224,10 +224,19 @@ if (function_exists("imagecreatefrompng") && ! $disabled)
|
|||||||
$captcha_refresh = img_picto($langs->trans("Refresh"),'refresh','id="captcha_refresh_img"');
|
$captcha_refresh = img_picto($langs->trans("Refresh"),'refresh','id="captcha_refresh_img"');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute hook getPasswordForgottenPageOptions
|
// Execute hook getPasswordForgottenPageOptions (for table)
|
||||||
// Should be an array with differents options in $hookmanager->resArray
|
|
||||||
$parameters=array('entity' => GETPOST('entity','int'));
|
$parameters=array('entity' => GETPOST('entity','int'));
|
||||||
$hookmanager->executeHooks('getPasswordForgottenPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks
|
$hookmanager->executeHooks('getPasswordForgottenPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) {
|
||||||
|
$morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility
|
||||||
|
} else {
|
||||||
|
$morelogincontent = $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute hook getPasswordForgottenPageExtraOptions (eg for js)
|
||||||
|
$parameters=array('entity' => GETPOST('entity','int'));
|
||||||
|
$reshook = $hookmanager->executeHooks('getPasswordForgottenPageExtraOptions',$parameters); // Note that $action and $object may have been modified by some hooks.
|
||||||
|
$moreloginextracontent = $hookmanager->resPrint;
|
||||||
|
|
||||||
include $template_dir.'passwordforgotten.tpl.php'; // To use native PHP
|
include $template_dir.'passwordforgotten.tpl.php'; // To use native PHP
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user