Merge branch 'develop' into product_supplier_buyprice_multicurrency

This commit is contained in:
kkhelifa-opendsi 2018-02-26 09:54:09 +01:00 committed by GitHub
commit 90f4c985f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
161 changed files with 971 additions and 706 deletions

View File

@ -171,6 +171,7 @@ then
cp -pr $mydir/../../htdocs/install/doctemplates/* "$documentdir/doctemplates/"
mkdir -p "$documentdir/ecm/Administrative documents"
mkdir -p "$documentdir/ecm/Images"
rm -f "$documentdir/doctemplates/"*/index.html
echo cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images"
else

View File

@ -35,6 +35,7 @@ class AdherentType extends CommonObject
public $table_element = 'adherent_type';
public $element = 'adherent_type';
public $picto = 'group';
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
* @var string
@ -307,7 +308,7 @@ class AdherentType extends CommonObject
$sql = "SELECT rowid, libelle as label";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type";
$sql.= " WHERE entity IN (".getEntity('adherent').")";
$sql.= " WHERE entity IN (".getEntity('member_type').")";
$resql=$this->db->query($sql);
if ($resql)

View File

@ -97,7 +97,7 @@ class MembersTypes extends DolibarrApi
$sql = "SELECT t.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t";
$sql.= ' WHERE t.entity IN ('.getEntity('adherent').')';
$sql.= ' WHERE t.entity IN ('.getEntity('member_type').')';
// Add sql filters
if ($sqlfilters)

View File

@ -65,7 +65,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."adherent as d";
$sql.= " ON t.rowid = d.fk_adherent_type";
$sql.= " AND d.entity IN (".getEntity('adherent').")";
$sql.= " WHERE t.entity IN (".getEntity('adherent').")";
$sql.= " WHERE t.entity IN (".getEntity('member_type').")";
$sql.= " GROUP BY t.rowid, t.libelle, t.subscription, d.statut";
dol_syslog("index.php::select nb of members by type", LOG_DEBUG);

View File

@ -574,7 +574,7 @@ if (! empty($arrayfields['d.datefin']['checked'])) print_liste_field_titr
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters=array('arrayfields'=>$arrayfields);
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['d.datec']['checked'])) print_liste_field_titre($arrayfields['d.datec']['label'],$_SERVER["PHP_SELF"],"d.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);

View File

@ -216,7 +216,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
$sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.vote";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
$sql.= " WHERE d.entity IN (".getEntity('adherent').")";
$sql.= " WHERE d.entity IN (".getEntity('member_type').")";
$result = $db->query($sql);
if ($result)

View File

@ -163,8 +163,6 @@ foreach ($modulesdir as $dir)
$modules[$i] = $objMod;
$filename[$i]= $modName;
$special = $objMod->special;
// Gives the possibility to the module, to provide his own family info and position of this family
if (is_array($objMod->familyinfo) && !empty($objMod->familyinfo)) {
if (!is_array($familyinfo)) $familyinfo=array();
@ -180,13 +178,11 @@ foreach ($modulesdir as $dir)
$moduleposition = 800;
}
if ($special == 1) $familykey='interface';
$orders[$i] = $familyinfo[$familykey]['position']."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number
$dirmod[$i] = $dir;
//print $i.'-'.$dirmod[$i].'<br>';
// Set categ[$i]
$specialstring = isset($specialtostring[$special])?$specialtostring[$special]:'unknown';
$specialstring = 'unknown';
if ($objMod->version == 'development' || $objMod->version == 'experimental') $specialstring='expdev';
if (isset($categ[$specialstring])) $categ[$specialstring]++; // Array of all different modules categories
else $categ[$specialstring]=1;
@ -240,7 +236,6 @@ foreach($orders as $tmpkey => $tmpvalue)
$i++;
}
$value = $orders[$key];
$special = $objMod->special;
$tab=explode('_',$value);
$familyposition=$tab[0]; $familykey=$tab[1]; $module_position=$tab[2]; $numero=$tab[3];

View File

@ -358,8 +358,6 @@ foreach ($modulesdir as $dir)
$filename[$i]= $modName;
$modules[$modName] = $objMod;
$special = $objMod->special;
// Gives the possibility to the module, to provide his own family info and position of this family
if (is_array($objMod->familyinfo) && !empty($objMod->familyinfo)) {
$familyinfo = array_merge($familyinfo, $objMod->familyinfo);
@ -374,8 +372,6 @@ foreach ($modulesdir as $dir)
$moduleposition = 800;
}
if ($special == 1) $familykey='interface';
// Add list of warnings to show into arrayofwarnings and arrayofwarningsext
if (! empty($objMod->warnings_activation))
{
@ -390,7 +386,7 @@ foreach ($modulesdir as $dir)
$dirmod[$i] = $dir;
//print $i.'-'.$dirmod[$i].'<br>';
// Set categ[$i]
$specialstring = isset($specialtostring[$special])?$specialtostring[$special]:'unknown';
$specialstring = 'unknown';
if ($objMod->version == 'development' || $objMod->version == 'experimental') $specialstring='expdev';
if (isset($categ[$specialstring])) $categ[$specialstring]++; // Array of all different modules categories
else $categ[$specialstring]=1;
@ -531,12 +527,9 @@ if ($mode == 'common')
$objMod = $modules[$modName];
$dirofmodule = $dirmod[$key];
$special = $objMod->special;
//print $objMod->name." - ".$key." - ".$objMod->special.' - '.$objMod->version."<br>";
//print $objMod->name." - ".$key." - ".$objMod->version."<br>";
//if (($mode != (isset($specialtostring[$special])?$specialtostring[$special]:'unknown') && $mode != 'expdev')
if (($special >= 4 && $mode != 'expdev')
|| ($mode == 'expdev' && $objMod->version != 'development' && $objMod->version != 'experimental')) continue; // Discard if not for current tab
if ($mode == 'expdev' && $objMod->version != 'development' && $objMod->version != 'experimental') continue; // Discard if not for current tab
if (! $objMod->getName())
{
@ -741,12 +734,12 @@ if ($mode == 'common')
if (preg_match('/^([^@]+)@([^@]+)$/i',$urlpage,$regs))
{
$urltouse=dol_buildpath('/'.$regs[2].'/admin/'.$regs[1],1);
print '<a href="'.$urltouse.(preg_match('/\?/',$urltouse)?'&':'?').'backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a>';
print '<a href="'.$urltouse.(preg_match('/\?/',$urltouse)?'&':'?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a>';
}
else
{
$urltouse=$urlpage;
print '<a href="'.$urltouse.(preg_match('/\?/',$urltouse)?'&':'?').'backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a>';
print '<a href="'.$urltouse.(preg_match('/\?/',$urltouse)?'&':'?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a>';
}
}
}
@ -754,11 +747,11 @@ if ($mode == 'common')
}
else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs))
{
print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1],1).'?backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a></td>';
print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1],1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a></td>';
}
else
{
print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.$objMod->config_page_url.'?backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a></td>';
print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.$objMod->config_page_url.'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a></td>';
}
}
else

View File

@ -715,11 +715,12 @@ class Categorie extends CommonObject
}
}
// Save object we want to link category to into category instance to provide information to trigger
$this->linkto=$obj;
// Call trigger
$result=$this->call_trigger('CATEGORY_LINK',$user);
$this->linkto=$obj; // Deprecated. Save object we want to link category to into category instance to provide information to trigger
$this->context=array('linkto'=>$obj); // Save object we want to link category to into category instance to provide information to trigger
$result=$this->call_trigger('CATEGORY_LINK',$user);
if ($result < 0) { $error++; }
// End call triggers

View File

@ -189,9 +189,11 @@ if (empty($reshook))
if ($action == 'update_extras') {
$object->fetch($id);
$object->oldcopy = dol_clone($object);
// Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none'));
if ($ret < 0) $error++;
if (! $error)
{

View File

@ -1228,9 +1228,11 @@ if (empty($reshook))
}
else if ($action == 'update_extras') {
$object->oldcopy = dol_clone($object);
// Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none'));
if ($ret < 0) $error++;
if (! $error)
{

View File

@ -1316,7 +1316,7 @@ class Propal extends CommonObject
function fetch($rowid,$ref='')
{
$sql = "SELECT p.rowid, p.ref, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
$sql = "SELECT p.rowid, p.ref, p.entity, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
$sql.= ", p.total, p.tva, p.localtax1, p.localtax2, p.total_ht";
$sql.= ", p.datec";
$sql.= ", p.date_valid as datev";
@ -1362,6 +1362,7 @@ class Propal extends CommonObject
$obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid;
$this->entity = $obj->entity;
$this->ref = $obj->ref;
$this->ref_client = $obj->ref_client;

View File

@ -614,7 +614,7 @@ if ($resql)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters=array('arrayfields'=>$arrayfields);
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);

View File

@ -1268,9 +1268,11 @@ if (empty($reshook))
if ($action == 'update_extras')
{
$object->oldcopy = dol_clone($object);
// Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none'));
if ($ret < 0) $error++;
if (! $error)

View File

@ -1567,7 +1567,7 @@ class Commande extends CommonOrder
// Check parameters
if (empty($id) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1;
$sql = 'SELECT c.rowid, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_user_valid, c.fk_statut';
$sql = 'SELECT c.rowid, c.entity, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_user_valid, c.fk_statut';
$sql.= ', c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_tva, c.localtax1 as total_localtax1, c.localtax2 as total_localtax2, c.fk_cond_reglement, c.fk_mode_reglement, c.fk_availability, c.fk_input_reason';
$sql.= ', c.fk_account';
$sql.= ', c.date_commande';
@ -1597,12 +1597,14 @@ class Commande extends CommonOrder
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
$obj = $this->db->fetch_object($result);
if ($obj)
{
$this->id = $obj->rowid;
if ($result)
{
$obj = $this->db->fetch_object($result);
if ($obj)
{
$this->id = $obj->rowid;
$this->entity = $obj->entity;
$this->ref = $obj->ref;
$this->ref_client = $obj->ref_client;
$this->ref_customer = $obj->ref_client;

View File

@ -701,7 +701,7 @@ if ($resql)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters=array('arrayfields'=>$arrayfields);
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.date_creation","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);

View File

@ -2112,9 +2112,11 @@ if (empty($reshook))
if ($action == 'update_extras') {
$object->oldcopy = dol_clone($object);
// Fill array 'array_options' with data from add form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none'));
if ($ret < 0) $error++;
if (! $error) {

View File

@ -1237,7 +1237,7 @@ class Facture extends CommonInvoice
if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1;
$sql = 'SELECT f.rowid,f.facnumber,f.ref_client,f.ref_ext,f.ref_int,f.type,f.fk_soc,f.amount';
$sql = 'SELECT f.rowid,f.entity,f.facnumber,f.ref_client,f.ref_ext,f.ref_int,f.type,f.fk_soc,f.amount';
$sql.= ', f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc, f.revenuestamp';
$sql.= ', f.remise_percent, f.remise_absolue, f.remise';
$sql.= ', f.datef as df, f.date_pointoftax';
@ -1274,6 +1274,8 @@ class Facture extends CommonInvoice
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
$this->entity = $obj->entity;
$this->ref = $obj->facnumber;
$this->ref_client = $obj->ref_client;
$this->ref_ext = $obj->ref_ext;
@ -3840,6 +3842,7 @@ class Facture extends CommonInvoice
// Initialize parameters
$this->id=0;
$this->entity = 1;
$this->ref = 'SPECIMEN';
$this->specimen=1;
$this->socid = 1;

View File

@ -444,9 +444,11 @@ if (empty($reshook))
}
else if ($action == 'update_extras')
{
$object->oldcopy = dol_clone($object);
// Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none'));
if ($ret < 0) $error++;
if (! $error) {

View File

@ -862,7 +862,7 @@ if ($resql)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters=array('arrayfields'=>$arrayfields);
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'],$_SERVER["PHP_SELF"],"f.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);

View File

@ -880,7 +880,7 @@ if (empty($reshook))
// Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none'));
if ($ret < 0) $error++;
if (! $error) {

View File

@ -316,9 +316,10 @@ class Contrat extends CommonObject
*
* @param User $user Object User making action
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @param string $comment Comment
* @return int <0 if KO, >0 if OK
*/
function closeAll(User $user, $notrigger=0)
function closeAll(User $user, $notrigger=0, $comment='')
{
$this->db->begin();
@ -337,7 +338,7 @@ class Contrat extends CommonObject
$contratline->date_cloture=$now;
$contratline->fk_user_cloture=$user->id;
$contratline->statut='5';
$result=$contratline->close_line($user, $now);
$result=$contratline->close_line($user, $now, $comment, $notrigger);
if ($result < 0)
{
$error++;
@ -3140,9 +3141,10 @@ class ContratLigne extends CommonObjectLine
* @param User $user Objet User who close contract
* @param int $date_end Date end
* @param string $comment A comment typed by user
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, >0 if OK
*/
function close_line($user, $date_end, $comment = '')
function close_line($user, $date_end, $comment = '', $notrigger=0)
{
global $langs, $conf;
@ -3164,15 +3166,19 @@ class ContratLigne extends CommonObjectLine
$sql .= " WHERE rowid = " . $this->id . " AND statut = 4";
$resql = $this->db->query($sql);
if ($resql) {
// Call trigger
$result = $this->call_trigger('LINECONTRACT_CLOSE', $user);
if ($result < 0) {
$error++;
$this->db->rollback();
return -1;
if ($resql)
{
if (! $notrigger)
{
// Call trigger
$result = $this->call_trigger('LINECONTRACT_CLOSE', $user);
if ($result < 0) {
$error++;
$this->db->rollback();
return -1;
}
// End call triggers
}
// End call triggers
$this->db->commit();
return 1;

View File

@ -46,7 +46,7 @@ if (! empty($massaction) && count($toselect) < 1)
$error++;
setEventMessages($langs->trans("NoRecordSelected"), null, "warnings");
}
if (! $error && count($toselect) > $maxformassaction)
if (! $error && is_array($toselect) && count($toselect) > $maxformassaction)
{
setEventMessages($langs->trans('TooManyRecordForMassAction',$maxformassaction), null, 'errors');
$error++;

View File

@ -88,7 +88,7 @@ class box_members extends ModeleBoxes
$sql.= " a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,";
$sql.= " t.subscription";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as t";
$sql.= " WHERE a.entity = ".$conf->entity;
$sql.= " WHERE a.entity IN (".getEntity('member').")";
$sql.= " AND a.fk_adherent_type = t.rowid";
$sql.= " ORDER BY a.tms DESC";
$sql.= $db->plimit($max, 0);

View File

@ -316,6 +316,14 @@ abstract class CommonDocGenerator
'current_server_datehour_locale'=>dol_print_date($now,'dayhour','tzserver',$outputlangs),
);
foreach($conf->global as $key => $val)
{
if (preg_match('/(_pass|password|secret|_key|key$)/i', $keyfound)) $newval = '*****forbidden*****';
else $newval = $val;
$array_other['__['.$key.']__'] = $newval;
}
return $array_other;
}
@ -345,17 +353,19 @@ abstract class CommonDocGenerator
$sumcreditnote = $object->getSumCreditNotesUsed();
}
$date = ($object->element == 'contrat' ? $object->date_contrat : $object->date);
$resarray=array(
$array_key.'_id'=>$object->id,
$array_key.'_ref'=>$object->ref,
$array_key.'_ref_ext'=>$object->ref_ext,
$array_key.'_ref_customer'=>$object->ref_client,
$array_key.'_ref_supplier'=>(! empty($object->ref_fournisseur)?$object->ref_fournisseur:''),
$array_key.'_ref_customer'=>(! empty($object->ref_client) ? $object->ref_client : (empty($object->ref_customer) ? '' : $object->ref_customer)),
$array_key.'_ref_supplier'=>(! empty($object->ref_fournisseur) ? $object->ref_fournisseur : (empty($object->ref_supplier) ? '' : $object->ref_supplier)),
$array_key.'_source_invoice_ref'=>$invoice_source->ref,
// Dates
$array_key.'_hour'=>dol_print_date($object->date,'hour'),
$array_key.'_date'=>dol_print_date($object->date,'day'),
$array_key.'_date_rfc'=>dol_print_date($object->date,'dayrfc'),
$array_key.'_hour'=>dol_print_date($date,'hour'),
$array_key.'_date'=>dol_print_date($date,'day'),
$array_key.'_date_rfc'=>dol_print_date($date,'dayrfc'),
$array_key.'_date_limit'=>(! empty($object->date_lim_reglement)?dol_print_date($object->date_lim_reglement,'day'):''),
$array_key.'_date_end'=>(! empty($object->fin_validite)?dol_print_date($object->fin_validite,'day'):''),
$array_key.'_date_creation'=>dol_print_date($object->date_creation,'day'),

View File

@ -4116,6 +4116,7 @@ abstract class CommonObject
* @param int $hideref 1 to hide product reference. 0 by default
* @param null|array $moreparams Array to provide more information
* @return int >0 if OK, <0 if KO
* @see addFileIntoDatabaseIndex
*/
protected function commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams=null)
{
@ -4354,6 +4355,7 @@ abstract class CommonObject
/**
* Build thumb
* @TODO Move this into files.lib.php
*
* @param string $file Path file in UTF8 to original file to create thumbs from.
* @return void
@ -4532,7 +4534,7 @@ abstract class CommonObject
if ($key != 'rowid' && $key != 'tms' && $key != 'fk_member' && ! is_int($key))
{
// we can add this attribute to object
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('date','datetime')))
if (! empty($extrafields) && in_array($extrafields->attributes[$this->table_element]['type'][$key], array('date','datetime')))
{
//var_dump($extrafields->attributes[$this->table_element]['type'][$key]);
$this->array_options["options_".$key]=$this->db->jdate($value);
@ -4629,10 +4631,10 @@ abstract class CommonObject
foreach($new_array_options as $key => $value)
{
$attributeKey = substr($key,8); // Remove 'options_' prefix
$attributeType = $extrafields->attribute_type[$attributeKey];
$attributeLabel = $extrafields->attribute_label[$attributeKey];
$attributeParam = $extrafields->attribute_param[$attributeKey];
$attributeRequired = $extrafields->attribute_required[$attributeKey];
$attributeType = $extrafields->attributes[$this->table_element]['type'][$attributeKey];
$attributeLabel = $extrafields->attributes[$this->table_element]['label'][$attributeKey];
$attributeParam = $extrafields->attributes[$this->table_element]['param'][$attributeKey];
$attributeRequired = $extrafields->attributes[$this->table_element]['required'][$attributeKey];
if ($attributeRequired)
{
@ -4665,7 +4667,43 @@ abstract class CommonObject
$this->array_options[$key] = null;
}
break;*/
case 'price':
case 'password':
$algo='';
if ($this->array_options[$key] != '' && is_array($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']))
{
// If there is an encryption choice, we use it to crypt data before insert
$algo=reset(array_keys($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']));
if ($algo != '')
{
//global $action; // $action may be 'create', 'update', 'update_extras'...
//var_dump($action);
//var_dump($this->oldcopy);exit;
if (is_object($this->oldcopy)) // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
{
//var_dump($this->oldcopy->array_options[$key]); var_dump($this->array_options[$key]);
if ($this->array_options[$key] == $this->oldcopy->array_options[$key]) // If old value crypted in database is same than submited new value, it means we don't change it, so we don't update.
{
$new_array_options[$key] = $this->array_options[$key]; // Value is kept
}
else
{
// var_dump($algo);
$newvalue = dol_hash($this->array_options[$key], $algo);
$new_array_options[$key] = $newvalue;
}
}
else
{
$new_array_options[$key] = $this->array_options[$key]; // Value is kept
}
}
}
else // Common usage
{
$new_array_options[$key] = $this->array_options[$key];
}
break;
case 'price':
$new_array_options[$key] = price2num($this->array_options[$key]);
break;
case 'date':
@ -4723,7 +4761,7 @@ abstract class CommonObject
{
$attributeKey = substr($key,8); // Remove 'options_' prefix
// Add field of attribut
if ($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] != 'separate') // Only for other type than separator
$sql.=",".$attributeKey;
}
$sql .= ") VALUES (".$this->id;
@ -4731,8 +4769,8 @@ abstract class CommonObject
foreach($new_array_options as $key => $value)
{
$attributeKey = substr($key,8); // Remove 'options_' prefix
// Add field o fattribut
if($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate)
// Add field of attribute
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] != 'separate') // Only for other type than separator)
{
if ($new_array_options[$key] != '')
{
@ -4781,7 +4819,7 @@ abstract class CommonObject
* Update an exta field value for the current object.
* Data to describe values to update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...)
*
* @param string $key Key of the extrafield
* @param string $key Key of the extrafield (without starting 'options_')
* @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY)
* @param User $userused Object user
* @return int -1=error, O=did nothing, 1=OK
@ -4806,9 +4844,12 @@ abstract class CommonObject
$target_extrafields=$extrafields->fetch_name_optionals_label($this->table_element);
$value=$this->array_options["options_".$key];
$attributeType = $extrafields->attribute_type[$key];
$attributeLabel = $extrafields->attribute_label[$key];
$attributeParam = $extrafields->attribute_param[$key];
$attributeType = $extrafields->attributes[$this->table_element]['type'][$key];
$attributeLabel = $extrafields->attributes[$this->table_element]['label'][$key];
$attributeParam = $extrafields->attributes[$this->table_element]['param'][$key];
$attributeRequired = $extrafields->attributes[$this->table_element]['required'][$key];
switch ($attributeType)
{
case 'int':
@ -4838,7 +4879,7 @@ abstract class CommonObject
$this->array_options["options_".$key]=$this->db->idate($this->array_options["options_".$key]);
break;
case 'link':
$param_list=array_keys($attributeParam ['options']);
$param_list=array_keys($attributeParam['options']);
// 0 : ObjectName
// 1 : classPath
$InfoFieldList = explode(":", $param_list[0]);

View File

@ -234,7 +234,7 @@ class ExtraFields
$lengthdb='11';
} elseif($type=='password') {
$typedb='varchar';
$lengthdb='50';
$lengthdb='128';
} else {
$typedb=$type;
$lengthdb=$length;

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (c) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2018 Juanjo Menent <jmenent@2byte.es>
*
* 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
@ -194,9 +194,12 @@ class FormActions
$projectid = $object->fk_project;
if ($typeelement == 'project') $projectid = $object->id;
$buttontoaddnewevent = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(),'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid>0?'&socid='.$object->socid:'').($projectid>0?'&projectid='.$projectid:'').'&backtopage='.urlencode($urlbacktopage).'">';
$buttontoaddnewevent.= $langs->trans("AddEvent");
$buttontoaddnewevent.= '</a>';
if (! empty($conf->agenda->enabled))
{
$buttontoaddnewevent = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(),'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid>0?'&socid='.$object->socid:'').($projectid>0?'&projectid='.$projectid:'').'&backtopage='.urlencode($urlbacktopage).'">';
$buttontoaddnewevent.= $langs->trans("AddEvent");
$buttontoaddnewevent.= '</a>';
}
print '<!-- formactions->showactions -->'."\n";
print load_fiche_titre($title, $buttontoaddnewevent, '', 0, 0, '', $morehtmlright);

View File

@ -984,9 +984,10 @@ class FormMail extends Form
* @param Translate $outputlangs Output lang object
* @param int $id Id of template to find, or -1 for first found with lower position, or 0 for first found whatever is position
* @param int $active 1=Only active template, 0=Only disabled, -1=All
* @param string $label Label of template
* @return array array('topic'=>,'content'=>,..)
*/
public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id=0, $active=1)
public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id=0, $active=1, $label='')
{
$ret=array();
@ -996,6 +997,7 @@ class FormMail extends Form
$sql.= " AND entity IN (".getEntity('c_email_templates').")";
$sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // Get all public or private owned
if ($active >= 0) $sql.=" AND active = ".$active;
if ($label) $sql.=" AND label ='".$this->db->escape($label)."'";
if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')";
if ($id > 0) $sql.= " AND rowid=".$id;
if ($id == -1) $sql.= " AND position=0";

View File

@ -85,8 +85,6 @@ class FormMargin
$product = new ProductFournisseur($db);
if ($product->fetch_product_fournisseur_price($line->fk_fournprice))
$line->pa_ht = $product->fourn_unitprice * (1 - $product->fourn_remise_percent / 100);
if (isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == "2" && $product->fourn_unitcharges > 0)
$line->pa_ht += $product->fourn_unitcharges;
}
// si prix d'achat non renseigné et devrait l'être, alors prix achat = prix vente
if ((!isset($line->pa_ht) || $line->pa_ht == 0) && $line->subprice > 0 && (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)) {
@ -96,7 +94,7 @@ class FormMargin
$pv = $line->qty * $line->subprice * (1 - $line->remise_percent / 100);
$pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
$pa = $line->qty * $pa_ht;
// calcul des marges
if (isset($line->fk_remise_except) && isset($conf->global->MARGIN_METHODE_FOR_DISCOUNT)) { // remise
if ($conf->global->MARGIN_METHODE_FOR_DISCOUNT == '1') { // remise globale considérée comme produit

View File

@ -1027,6 +1027,7 @@ class Translate
foreach($this->tab_translate as $code => $label) {
$substitutionarray['lang_'.$code] = $label;
$substitutionarray['__('.$code.')__'] = $label;
}
return $substitutionarray;

View File

@ -1290,8 +1290,6 @@ function complete_elementList_with_modules(&$elementList)
$filename[$i]= $modName;
$orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module
//print "x".$modName." ".$orders[$i]."\n<br>";
if (isset($categ[$objMod->special])) $categ[$objMod->special]++; // Array of all different modules categories
else $categ[$objMod->special]=1;
$dirmod[$i] = $dirroot;
if (! empty($objMod->module_parts['contactelement']))
{

View File

@ -950,7 +950,7 @@ function dolCheckVirus($src_file)
* Note:
* - This function can be used only into a HTML page context. Use dol_move if you are outside.
* - Test on antivirus is always done (if antivirus set).
* - Database of files is NOT updated.
* - Database of files is NOT updated (this is done by dol_add_file_process() that calls this function).
*
* @param string $src_file Source full path filename ($_FILES['field']['tmp_name'])
* @param string $dest_file Target full path filename ($_FILES['field']['name'])
@ -1554,28 +1554,10 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
// Update table of files
if ($donotupdatesession)
{
$rel_dir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $upload_dir);
if (! preg_match('/[\\/]temp[\\/]|[\\/]thumbs|\.meta$/', $rel_dir)) // If not a tmp dir
$result = addFileIntoDatabaseIndex($upload_dir, basename($destfile), $TFile['name'][$i], 'uploaded', 0);
if ($result < 0)
{
$filename = basename($destfile);
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile=new EcmFiles($db);
$ecmfile->filepath = $rel_dir;
$ecmfile->filename = $filename;
$ecmfile->label = md5_file(dol_osencode($destfull)); // MD5 of file content
$ecmfile->fullpath_orig = $TFile['name'][$i];
$ecmfile->gen_or_uploaded = 'uploaded';
$ecmfile->description = ''; // indexed content
$ecmfile->keyword = ''; // keyword content
$result = $ecmfile->create($user);
if ($result < 0)
{
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
}
setEventMessages('FailedToAddFileIntoDatabaseIndex', '', 'warnings');
}
}
@ -1679,6 +1661,114 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=
}
}
/**
* Add a file into database index.
* Called by dol_add_file_process when uploading a file and on other cases.
* See also commonGenerateDocument that also add/update database index when a file is generated.
*
* @param string $dir Directory name (full real path without ending /)
* @param string $file File name
* @param string $fullpathorig Full path of origin for file (can be '')
* @param string $mode How file was created ('uploaded', 'generated', ...)
* @param int $setsharekey Set also the share key
* @return int <0 if KO, 0 if nothing done, >0 if OK
*/
function addFileIntoDatabaseIndex($dir, $file, $fullpathorig='', $mode='uploaded', $setsharekey=0)
{
global $db, $user;
$result = 0;
$rel_dir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $dir);
if (! preg_match('/[\\/]temp[\\/]|[\\/]thumbs|\.meta$/', $rel_dir)) // If not a tmp dir
{
$filename = basename($file);
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile=new EcmFiles($db);
$ecmfile->filepath = $rel_dir;
$ecmfile->filename = $filename;
$ecmfile->label = md5_file(dol_osencode($dir.'/'.$file)); // MD5 of file content
$ecmfile->fullpath_orig = $fullpathorig;
$ecmfile->gen_or_uploaded = $mode;
$ecmfile->description = ''; // indexed content
$ecmfile->keyword = ''; // keyword content
if ($setsharekey)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
$ecmfile->share = getRandomPassword(true);
}
$result = $ecmfile->create($user);
if ($result < 0)
{
dol_syslog($ecmfile->error);
}
}
return $result;
}
/**
* Delete files into database index using search criterias.
*
* @param string $dir Directory name (full real path without ending /)
* @param string $file File name
* @param string $mode How file was created ('uploaded', 'generated', ...)
* @return int <0 if KO, 0 if nothing done, >0 if OK
*/
function deleteFilesIntoDatabaseIndex($dir, $file, $mode='uploaded')
{
global $conf, $db, $user;
$error = 0;
if (empty($dir))
{
dol_syslog("deleteFilesIntoDatabaseIndex: dir parameter can't be empty", LOG_ERR);
return -1;
}
$db->begin();
$rel_dir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $dir);
$filename = basename($file);
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);
if (! $error)
{
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'ecm_files';
$sql.= ' WHERE entity = '.$conf->entity;
$sql.= " AND filepath = '" . $db->escape($rel_dir) . "'";
if ($file) $sql.= " AND filename = '" . $db->escape($file) . "'";
if ($mode) $sql.= " AND gen_or_uploaded = '" . $db->escape($mode) . "'";
$resql = $db->query($sql);
if (!$resql)
{
$error++;
dol_syslog(__METHOD__ . ' ' . $db->lasterror(), LOG_ERR);
}
}
// Commit or rollback
if ($error) {
$db->rollback();
return - 1 * $error;
} else {
$db->commit();
return 1;
}
}
/**
* Convert an image file into another format.
* This need Imagick php extension.

View File

@ -5767,12 +5767,14 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
{
$substitutionarray['__THIRDPARTY_ID__'] = (is_object($object)?$object->id:'');
$substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object)?$object->name:'');
$substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = (is_object($object)?$object->name_alias:'');
$substitutionarray['__THIRDPARTY_EMAIL__'] = (is_object($object)?$object->email:'');
}
elseif (is_object($object->thirdparty) && $object->thirdparty->id > 0)
{
$substitutionarray['__THIRDPARTY_ID__'] = (is_object($object->thirdparty)?$object->thirdparty->id:'');
$substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object->thirdparty)?$object->thirdparty->name:'');
$substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = (is_object($object->thirdparty)?$object->thirdparty->name_alias:'');
$substitutionarray['__THIRDPARTY_EMAIL__'] = (is_object($object->thirdparty)?$object->thirdparty->email:'');
}
@ -5945,7 +5947,8 @@ function make_substitutions($text, $substitutionarray, $outputlangs=null)
if (dol_textishtml($text,1)) $msgishtml = 1;
$keyfound = $reg[1];
$newval=empty($conf->global->$keyfound)?'':$conf->global->$keyfound;
if (preg_match('/(_pass|password|secret|_key|key$)/i', $keyfound)) $newval = '*****forbidden*****';
else $newval=empty($conf->global->$keyfound)?'':$conf->global->$keyfound;
$text = preg_replace('/__\['.preg_quote($keyfound, '/').'\]__/', $msgishtml?dol_htmlentitiesbr($newval):$newval, $text);
}

View File

@ -70,11 +70,11 @@ function dol_decode($chain)
/**
* Returns a hash of a string.
* If constant MAIN_SECURITY_HASH_ALGO is defined, we use this function as hashing function.
* If constant MAIN_SECURITY_SALT is defined, we use it as a salt.
* If constant MAIN_SECURITY_HASH_ALGO is defined, we use this function as hashing function (recommanded value is 'password_hash')
* If constant MAIN_SECURITY_SALT is defined, we use it as a salt (used only if hashing algorightm is something else than 'password_hash').
*
* @param string $chain String to hash
* @param string $type Type of hash ('0':auto, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap, '5':sha256). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
* @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO then md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap, '5':sha256). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
* @return string Hash of string
* @getRandomPassword
*/
@ -83,8 +83,10 @@ function dol_hash($chain, $type='0')
global $conf;
// No need to add salt for password_hash
if ($type == '0' && ! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'password_hash' && function_exists('password_hash'))
return password_hash($chain, PASSWORD_DEFAULT);
if (($type == '0' || $type == 'auto') && ! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'password_hash' && function_exists('password_hash'))
{
return password_hash($chain, PASSWORD_DEFAULT);
}
// Salt value
if (! empty($conf->global->MAIN_SECURITY_SALT)) $chain=$conf->global->MAIN_SECURITY_SALT.$chain;

View File

@ -163,7 +163,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
}
$texte.='<div id="div_'.get_class($this).'">';
}
$texte.= '</td>';
$texte.= '<td valign="top" rowspan="2" class="hideonsmartphone">';
@ -354,21 +354,22 @@ class doc_generic_order_odt extends ModelePDFCommandes
{
}
// Make substitutions into odt
// Define substitution array
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
$array_object_from_properties=$this->get_substitutionarray_each_var_object($object, $outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_user=$this->get_substitutionarray_user($user,$outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in order as contact_xxx tags
$array_thirdparty_contact = array();
if ($usecontact)
$array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
// retrieve contact information for use in order as contact_xxx tags
$array_thirdparty_contact = array();
if ($usecontact) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
$tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
@ -392,30 +393,42 @@ class doc_generic_order_odt extends ModelePDFCommandes
// Replace tags of lines
try
{
$listlines = $odfHandler->setSegment('lines');
foreach ($object->lines as $line)
{
$tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
$reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
foreach($tmparray as $key => $val)
{
try
{
$listlines->setVars($key, $val, true, 'UTF-8');
}
catch(OdfException $e)
{
}
catch(SegmentException $e)
{
}
}
$listlines->merge();
$foundtagforlines = 1;
try {
$listlines = $odfHandler->setSegment('lines');
}
catch(OdfException $e)
{
// We may arrive here if tags for lines not present into template
$foundtagforlines = 0;
dol_syslog($e->getMessage(), LOG_INFO);
}
if ($foundtagforlines)
{
foreach ($object->lines as $line)
{
$tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
$reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
foreach($tmparray as $key => $val)
{
try
{
$listlines->setVars($key, $val, true, 'UTF-8');
}
catch(OdfException $e)
{
}
catch(SegmentException $e)
{
}
}
$listlines->merge();
}
$odfHandler->mergeSegment($listlines);
}
$odfHandler->mergeSegment($listlines);
}
catch(OdfException $e)
{
@ -468,7 +481,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -290,27 +290,40 @@ class doc_generic_contract_odt extends ModelePDFContract
{
$socobject=$object->thirdparty;
}
// Make substitution
$substitutionarray=array(
'__FROM_NAME__' => $this->emetteur->name,
'__FROM_EMAIL__' => $this->emetteur->email,
'__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht,
'__TOTAL_VAT__' => $object->total_vat
);
complete_substitutions_array($substitutionarray, $langs, $object);
$object->fetch_optionals();
// Define substitution array
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
$array_object_from_properties=$this->get_substitutionarray_each_var_object($object, $outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs); // complete with vars not set as properties by get_substitutionarray_each_var_object
$array_user=$this->get_substitutionarray_user($user,$outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in contract as contact_xxx tags
$array_thirdparty_contact = array();
if ($usecontact) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$substitutionarray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$tmparray = $substitutionarray;
// Call the ODTSubstitution hook
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$substitutionarray);
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
// Line of free text
$newfreetext='';
$paramfreetext='contract_FREE_TEXT';
$paramfreetext='CONTRACT_FREE_TEXT';
if (! empty($conf->global->$paramfreetext))
{
$newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray);
$newfreetext=make_substitutions($conf->global->$paramfreetext,$tmparray);
}
// Open and load template
require_once ODTPHP_PATH.'odf.php';
try {
@ -344,24 +357,6 @@ class doc_generic_contract_odt extends ModelePDFContract
{
}
// Make substitutions into odt
$array_contract=$this->get_substitutionarray_each_var_object($object, $outputlangs);
$array_user=$this->get_substitutionarray_user($user,$outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in contract as contact_xxx tags
$array_thirdparty_contact = array();
if ($usecontact)
$array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$tmparray = array_merge($array_contract,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object);
$object->fetch_optionals();
// Call the ODTSubstitution hook
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
foreach($tmparray as $key=>$value)
{
try {
@ -379,33 +374,46 @@ class doc_generic_contract_odt extends ModelePDFContract
{
}
}
// Replace tags of lines
try
{
$listlines = $odfHandler->setSegment('lines');
foreach ($object->lines as $line)
{
$tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
$reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
foreach($tmparray as $key => $val)
{
try
{
$listlines->setVars($key, $val, true, 'UTF-8');
}
catch(OdfException $e)
{
}
catch(SegmentException $e)
{
}
}
$listlines->merge();
$foundtagforlines = 1;
try {
$listlines = $odfHandler->setSegment('lines');
}
catch(OdfException $e)
{
// We may arrive here if tags for lines not present into template
$foundtagforlines = 0;
dol_syslog($e->getMessage(), LOG_INFO);
}
if ($foundtagforlines)
{
foreach ($object->lines as $line)
{
$tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
$reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
foreach($tmparray as $key => $val)
{
try
{
$listlines->setVars($key, $val, true, 'UTF-8');
}
catch(OdfException $e)
{
}
catch(SegmentException $e)
{
}
}
$listlines->merge();
}
$odfHandler->mergeSegment($listlines);
}
$odfHandler->mergeSegment($listlines);
}
catch(OdfException $e)
{
@ -456,7 +464,7 @@ class doc_generic_contract_odt extends ModelePDFContract
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -437,30 +437,42 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
// Replace tags of lines
try
{
$listlines = $odfHandler->setSegment('lines');
foreach ($object->lines as $line)
{
$tmparray=$this->get_substitutionarray_shipment_lines($line,$outputlangs);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
$reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
foreach($tmparray as $key => $val)
{
try
{
$listlines->setVars($key, $val, true, 'UTF-8');
}
catch(OdfException $e)
{
}
catch(SegmentException $e)
{
}
}
$listlines->merge();
$foundtagforlines = 1;
try {
$listlines = $odfHandler->setSegment('lines');
}
catch(OdfException $e)
{
// We may arrive here if tags for lines not present into template
$foundtagforlines = 0;
dol_syslog($e->getMessage(), LOG_INFO);
}
if ($foundtagforlines)
{
foreach ($object->lines as $line)
{
$tmparray=$this->get_substitutionarray_shipment_lines($line,$outputlangs);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
$reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
foreach($tmparray as $key => $val)
{
try
{
$listlines->setVars($key, $val, true, 'UTF-8');
}
catch(OdfException $e)
{
}
catch(SegmentException $e)
{
}
}
$listlines->merge();
}
$odfHandler->mergeSegment($listlines);
}
$odfHandler->mergeSegment($listlines);
}
catch(OdfException $e)
{
@ -511,7 +523,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -328,7 +328,15 @@ class pdf_standard extends ModeleExpenseReport
$nextColumnPosX = $this->posxprojet;
}
$pdf->MultiCell($nextColumnPosX-$this->posxtype-0.8, 4, dol_trunc($outputlangs->transnoentities($object->lines[$i]->type_fees_code), 10), 0, 'C');
$expensereporttypecode = $object->lines[$i]->type_fees_code;
$expensereporttypecodetoshow = $outputlangs->transnoentities($expensereporttypecode);
if ($expensereporttypecodetoshow == $expensereporttypecode)
{
$expensereporttypecodetoshow = preg_replace('/^(EX_|TF_)/', '', $expensereporttypecodetoshow);
}
$expensereporttypecodetoshow = dol_trunc($expensereporttypecodetoshow, 9); // 10 is too much
$pdf->MultiCell($nextColumnPosX-$this->posxtype-0.8, 4, $expensereporttypecodetoshow, 0, 'C');
// Project
if (! empty($conf->projet->enabled))

View File

@ -361,20 +361,22 @@ class doc_generic_invoice_odt extends ModelePDFFactures
{
}
// Make substitutions into odt
// Define substitution array
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
$array_object_from_properties=$this->get_substitutionarray_each_var_object($object, $outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_user=$this->get_substitutionarray_user($user,$outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_propal=is_object($propal_object)?$this->get_substitutionarray_object($propal_object,$outputlangs,'propal'):array();
$array_other=$this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in invoice as contact_xxx tags
$array_thirdparty_contact = array();
if ($usecontact)
$array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
// retrieve contact information for use in invoice as contact_xxx tags
$array_thirdparty_contact = array();
if ($usecontact) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other,$array_thirdparty_contact);
$tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
@ -401,30 +403,42 @@ class doc_generic_invoice_odt extends ModelePDFFactures
// Replace tags of lines
try
{
$listlines = $odfHandler->setSegment('lines');
foreach ($object->lines as $line)
{
$tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
$reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
foreach($tmparray as $key => $val)
{
try
{
$listlines->setVars($key, $val, true, 'UTF-8');
}
catch(OdfException $e)
{
}
catch(SegmentException $e)
{
}
}
$listlines->merge();
$foundtagforlines = 1;
try {
$listlines = $odfHandler->setSegment('lines');
}
catch(OdfException $e)
{
// We may arrive here if tags for lines not present into template
$foundtagforlines = 0;
dol_syslog($e->getMessage(), LOG_INFO);
}
if ($foundtagforlines)
{
foreach ($object->lines as $line)
{
$tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
$reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
foreach($tmparray as $key => $val)
{
try
{
$listlines->setVars($key, $val, true, 'UTF-8');
}
catch(OdfException $e)
{
}
catch(SegmentException $e)
{
}
}
$listlines->merge();
}
$odfHandler->mergeSegment($listlines);
}
$odfHandler->mergeSegment($listlines);
}
catch(OdfException $e)
{
@ -475,7 +489,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -127,7 +127,7 @@ class mailing_fraise extends MailingTargets
$s.='<select name="filter_type" class="flat">';
$sql = "SELECT rowid, libelle, statut";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type";
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " WHERE entity IN (".getEntity('member_type').")";
$sql.= " ORDER BY rowid";
$resql = $this->db->query($sql);
if ($resql)

View File

@ -54,7 +54,6 @@ class modAccounting extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
$this->special = 0;
$this->picto = 'accounting';
// Data directories to create when module is enabled

View File

@ -56,7 +56,6 @@ class modAdherent extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='user';
// Data directories to create when module is enabled
@ -291,7 +290,7 @@ class modAdherent extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'subscription as c ON c.fk_adherent = a.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON a.state_id = d.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON a.country = co.rowid';
$this->export_sql_end[$r] .=' WHERE a.fk_adherent_type = ta.rowid AND ta.entity IN ('.getEntity('adherent').') ';
$this->export_sql_end[$r] .=' WHERE a.fk_adherent_type = ta.rowid AND ta.entity IN ('.getEntity('member_type').') ';
$this->export_dependencies_array[$r]=array('subscription'=>'c.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
// Imports

View File

@ -59,7 +59,6 @@ class modAgenda extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='action';
// Data directories to create when module is enabled

View File

@ -51,7 +51,7 @@ class modApi extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "technic";
$this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
@ -60,8 +60,6 @@ class modApi extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'

View File

@ -58,7 +58,6 @@ class modBanque extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='account';
// Data directories to create when module is enabled
@ -138,8 +137,8 @@ class modBanque extends DolibarrModules
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
// Exports
//--------
$r=0;

View File

@ -51,7 +51,6 @@ class modBarcode extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 2;
$this->picto='barcode';
// Data directories to create when module is enabled

View File

@ -55,8 +55,6 @@ class modBlockedLog extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 2;
// Name of image file used for this module.
$this->picto='technic';

View File

@ -52,7 +52,6 @@ class modBookmark extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 2;
$this->picto='bookmark';
// Data directories to create when module is enabled
@ -98,10 +97,10 @@ class modBookmark extends DolibarrModules
$this->rights[$r][3] = 0; // La permission est-elle une permission par d<>faut
$this->rights[$r][4] = 'supprimer';
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
}
}

View File

@ -55,7 +55,6 @@ class modCashDesk extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto = 'list';
// Data directories to create when module is enabled

View File

@ -54,7 +54,6 @@ class modCategorie extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto = 'category';
// Data directories to create when module is enabled
@ -107,12 +106,12 @@ class modCategorie extends DolibarrModules
$this->rights[$r][4] = 'supprimer';
$r++;
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
// Exports
//--------
$r=0;
@ -308,7 +307,7 @@ class modCategorie extends DolibarrModules
's.url'=>"company",
's.email'=>"company"
); // We define here only fields that use another picto
// Add extra fields
$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople'";
$resql=$this->db->query($sql);
@ -346,7 +345,7 @@ class modCategorie extends DolibarrModules
}
}
// End add axtra fields
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
$this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'categorie as u, '.MAIN_DB_PREFIX . 'categorie_contact as cp, '.MAIN_DB_PREFIX . 'socpeople as p';
$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_country as country ON p.fk_pays = country.rowid';

View File

@ -43,7 +43,7 @@ class modClickToDial extends DolibarrModules
$this->db = $db;
$this->numero = 58;
$this->family = "technic";
$this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion du Click To Dial";
@ -51,7 +51,6 @@ class modClickToDial extends DolibarrModules
$this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 1;
$this->picto='phoning';
// Data directories to create when module is enabled

View File

@ -54,8 +54,6 @@ class modCollab extends DolibarrModules
$this->version = 'development';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 0;
// Name of image file used for this module.
$this->picto='globe';

View File

@ -59,7 +59,6 @@ class modCommande extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='order';
// Data directories to create when module is enabled
@ -104,7 +103,7 @@ class modCommande extends DolibarrModules
$this->const[$r][2] = "__(Draft)__";
$this->const[$r][3] = 'Watermark to show on draft orders';
$this->const[$r][4] = 0;*/
// Boxes
$this->boxes = array(
0=>array('file'=>'box_commandes.php','enabledbydefaulton'=>'Home'),
@ -177,12 +176,12 @@ class modCommande extends DolibarrModules
$this->rights[$r][4] = 'commande';
$this->rights[$r][5] = 'export';
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
// Exports
//--------
$r=0;

View File

@ -57,7 +57,6 @@ class modComptabilite extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='accounting';
// Config pages
@ -94,12 +93,12 @@ class modComptabilite extends DolibarrModules
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'resultat';
$this->rights[$r][5] = 'lire';
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
}

View File

@ -55,7 +55,6 @@ class modContrat extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='contract';
// Data directories to create when module is enabled
@ -71,28 +70,28 @@ class modContrat extends DolibarrModules
// Constants
$this->const = array();
$r=0;
$this->const[$r][0] = "CONTRACT_ADDON";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_contract_serpis";
$this->const[$r][3] = 'Nom du gestionnaire de numerotation des contrats';
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "CONTRACT_ADDON_PDF";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "strato";
$this->const[$r][3] = 'Name of PDF model of contract';
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "CONTRACT_ADDON_PDF_ODT_PATH";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/contracts";
$this->const[$r][3] = "";
$this->const[$r][4] = 0;
$r++;
// Boxes
$this->boxes = array(
0=>array('file'=>'box_contracts.php','enabledbydefaulton'=>'Home'),
@ -103,7 +102,7 @@ class modContrat extends DolibarrModules
$this->rights = array();
$this->rights_class = 'contrat';
$r=0;
$r++;
$this->rights[$r][0] = 161;
$this->rights[$r][1] = 'Lire les contrats';
@ -146,12 +145,12 @@ class modContrat extends DolibarrModules
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'export';
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
// Exports
//--------
$langs->load("contracts");
@ -223,7 +222,7 @@ class modContrat extends DolibarrModules
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/contracts/template_contract.odt';
$dirodt=DOL_DATA_ROOT.'/doctemplates/contracts';
$dest=$dirodt.'/template_contract.odt';
if (file_exists($src) && ! file_exists($dest))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -236,12 +235,12 @@ class modContrat extends DolibarrModules
return 0;
}
}
$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[1][2])."' AND type = 'contract' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[1][2])."','contract',".$conf->entity.")"
);
return $this->_init($sql,$options);
}
}

View File

@ -54,8 +54,6 @@ class modCron extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 2;
// Name of image file used for this module.
$this->picto = 'technic';

View File

@ -54,7 +54,6 @@ class modDeplacement extends DolibarrModules
$this->version = 'dolibarr_deprecated';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto = "trip";
// Data directories to create when module is enabled
@ -108,12 +107,12 @@ class modDeplacement extends DolibarrModules
$this->rights[5][3] = 0;
$this->rights[5][4] = 'export';
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
// Exports
$r=0;
@ -134,12 +133,12 @@ class modDeplacement extends DolibarrModules
$this->export_sql_end[$r] .=' WHERE d.fk_user = u.rowid';
$this->export_sql_end[$r] .=' AND d.entity IN ('.getEntity('deplacement').')';
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR d.fk_soc IS NULL)';
if (! empty($user)) // Not defined during migration process
{
$childids = $user->getAllChildIds();
$childids[]=$user->id;
if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) $sql.=' AND d.fk_user IN ('.join(',',$childids).')';
}
}

View File

@ -53,7 +53,6 @@ class modDocumentGeneration extends DolibarrModules
$this->version = 'development';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='email';
// Data directories to create when module is enabled

View File

@ -52,7 +52,6 @@ class modDon extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
// Name of png file (without png) used for this module.
// Png file must be in theme/yourtheme/img directory under name object_pictovalue.png.
$this->picto='bill';

View File

@ -49,8 +49,6 @@ class modDynamicPrices extends DolibarrModules
$this->version = 'experimental';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 0;
// Name of image file used for this module.
$this->picto='technic';

View File

@ -57,8 +57,6 @@ class modECM extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (XXX is id value)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=other)
$this->special = 0;
// Name of png file (without png) used for this module
$this->picto='dir';

View File

@ -58,7 +58,6 @@ class modExpedition extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto = "sending";
// Data directories to create when module is enabled
@ -222,8 +221,8 @@ class modExpedition extends DolibarrModules
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
// Exports
//--------
$r=0;

View File

@ -51,7 +51,6 @@ class modExpenseReport extends DolibarrModules
$this->description = "Manage and claim expense reports (transportation, meal, ...)";
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='trip';
// Data directories to create when module is enabled.

View File

@ -51,7 +51,6 @@ class modExport extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto = 'technic';
// Data directories to create when module is enabled

View File

@ -52,7 +52,6 @@ class modExternalRss extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 1;
$this->picto='rss';
// Data directories to create when module is enabled

View File

@ -49,7 +49,7 @@ class modExternalSite extends DolibarrModules
// Family can be 'crm','financial','hr','projects','product','technic','other'
// It is used to sort modules in module setup page
$this->family = "other";
$this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value)
@ -58,8 +58,6 @@ class modExternalSite extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (XXX is id value)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=other)
$this->special = 1;
// Name of png file (without png) used for this module
$this->picto='bookmark';
// Call to inside lang's file

View File

@ -48,7 +48,7 @@ class modFTP extends DolibarrModules
// Family can be 'crm','financial','hr','projects','product','ecm','technic','other'
// It is used to sort modules in module setup page
$this->family = "other";
$this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value)
@ -57,8 +57,6 @@ class modFTP extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (XXX is id value)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 1;
// Name of png file (without png) used for this module
$this->picto='dir';
@ -110,7 +108,7 @@ class modFTP extends DolibarrModules
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'write';
// Menus
//-------
$this->menu[$r]=array('fk_menu'=>0,

View File

@ -57,7 +57,6 @@ class modFacture extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto = 'bill';
// Data directories to create when module is enabled

View File

@ -52,7 +52,6 @@ class modFckeditor extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 2;
// Name of png file (without png) used for this module.
// Png file must be in theme/yourtheme/img directory under name object_pictovalue.png.
$this->picto='list';

View File

@ -58,7 +58,6 @@ class modFicheinter extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto = "intervention";
// Data directories to create when module is enabled
@ -147,12 +146,12 @@ class modFicheinter extends DolibarrModules
$this->rights[$r][4] = 'ficheinter_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
$this->rights[$r][5] = 'unvalidate';
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
//Exports
//--------
$r=1;

View File

@ -59,7 +59,6 @@ class modFournisseur extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='company';
// Data directories to create when module is enabled

View File

@ -44,7 +44,7 @@ class modGeoIPMaxmind extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "technic";
$this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
@ -53,8 +53,6 @@ class modGeoIPMaxmind extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/images directory, use this->picto=DOL_URL_ROOT.'/module/images/file.png'

View File

@ -48,7 +48,7 @@ class modGravatar extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "technic";
$this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i', '', get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
@ -57,8 +57,6 @@ class modGravatar extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/images directory, use this->picto=DOL_URL_ROOT.'/module/images/file.png'

View File

@ -31,41 +31,40 @@ class modHRM extends DolibarrModules
* Constructor.
* Define names, constants, directories, boxes, permissions
*
* @param DoliDB $db
* @param DoliDB $db Database handler
*/
public function __construct($db)
{
global $langs, $conf;
$this->db = $db;
$this->numero = 4000;
$this->rights_class = 'hrm';
$this->family = "hr";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace( '/^mod/i', '', get_class($this));
$this->description = "Management of employees carrier and feelings (department, employment contract)";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'development';
$this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
$this->special = 0;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
$this->picto='generic';
// define triggers
$this->module_parts = array();
// Data directories to create when module is enabled
$this->dirs = array();
// Config pages
$this->config_page_url = array('admin_hrm.php@hrm');
// Dependencies
$this->depends = array();
$this->requiredby = array(/*"
@ -76,14 +75,14 @@ class modHRM extends DolibarrModules
$this->conflictwith = array();
$this->phpmin = array (
5,
3
3
); // Minimum version of PHP required by module
$this->need_dolibarr_version = array (
3,
9
9
); // Minimum version of Dolibarr required by module
$this->langfiles = array (
"hrm"
"hrm"
);
// Dictionnaries
@ -95,7 +94,7 @@ class modHRM extends DolibarrModules
// Boxes
$this->boxes = array ();
// Permissions
$this->rights = array(); // Permission array used by this module
$r = 0;
@ -106,21 +105,21 @@ class modHRM extends DolibarrModules
$this->rights[$r][4] = 'employee';
$this->rights[$r][5] = 'read';
$r ++;
$this->rights[$r][0] = 4002;
$this->rights[$r][1] = 'Create employees';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'employee';
$this->rights[$r][5] = 'write';
$r ++;
$this->rights[$r][0] = 4003;
$this->rights[$r][1] = 'Delete employees';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'employee';
$this->rights[$r][5] = 'delete';
$r ++;
$this->rights[$r][0] = 4004;
$this->rights[$r][1] = 'Export employees';
$this->rights[$r][3] = 0;
@ -128,13 +127,13 @@ class modHRM extends DolibarrModules
$this->rights[$r][5] = 'export';
$r ++;
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
}
/**
* Function called when module is enabled.
* The init function add constants, boxes, permissions and menus

View File

@ -62,8 +62,6 @@ class modHoliday extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 0;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'

View File

@ -51,7 +51,6 @@ class modImport extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto = 'technic';
// Data directories to create when module is enabled

View File

@ -57,8 +57,6 @@ class modIncoterm extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 0;
$this->picto='generic';
$this->module_parts = array();

View File

@ -51,7 +51,6 @@ class modLabel extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'development';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 2;
$this->picto='label';
// Data directories to create when module is enabled

View File

@ -42,15 +42,13 @@ class modLdap extends DolibarrModules
$this->db = $db;
$this->numero = 200;
$this->family = "technic";
$this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Synchronisation Ldap";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/images directory, use this->picto=DOL_URL_ROOT.'/module/images/file.png'

View File

@ -54,7 +54,6 @@ class modLoan extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='bill';
// Data directories to create when module is enabled
@ -118,7 +117,7 @@ class modLoan extends DolibarrModules
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'delete';
$this->rights[$r][5] = '';
$r++;
$this->rights[$r][0] = 525;
$this->rights[$r][1] = 'Access loan calculator';
@ -135,12 +134,12 @@ class modLoan extends DolibarrModules
$this->rights[$r][4] = 'export';
$this->rights[$r][5] = '';
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
// Exports
//--------
$r=0;

View File

@ -51,7 +51,6 @@ class modMailing extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='email';
// Data directories to create when module is enabled

View File

@ -43,7 +43,7 @@ class modMailmanSpip extends DolibarrModules
$this->db = $db;
$this->numero = 105;
$this->family = "technic";
$this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Mailman or Spip interface for member module";
@ -52,7 +52,6 @@ class modMailmanSpip extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 1;
$this->picto='technic';
// Data directories to create when module is enabled

View File

@ -57,8 +57,6 @@ class modMargin extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=other)
$this->special = 2;
// Name of png file (without png) used for this module.
// Png file must be in theme/yourtheme/img directory under name object_pictovalue.png.
$this->picto='margin';

View File

@ -51,8 +51,6 @@ class modModuleBuilder extends DolibarrModules
$this->version = 'experimental';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 1;
// Name of image file used for this module.
$this->picto='technic';

View File

@ -65,8 +65,6 @@ class modMultiCurrency extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 0;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'

View File

@ -41,7 +41,7 @@ class modNotification extends DolibarrModules
$this->db = $db;
$this->numero = 600;
$this->family = "technic";
$this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "EMail notifications (push) on business Dolibarr events";
@ -49,7 +49,6 @@ class modNotification extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 1;
$this->picto='email';
// Data directories to create when module is enabled.

View File

@ -46,7 +46,7 @@ class modOauth extends DolibarrModules
$this->numero = 66000;
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "technic";
$this->family = "interface";
$this->module_position = 510;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
@ -55,8 +55,6 @@ class modOauth extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'

View File

@ -61,8 +61,6 @@ class modOpenSurvey extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 0;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'

View File

@ -48,7 +48,7 @@ class modPayBox extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "other";
$this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
@ -57,8 +57,6 @@ class modPayBox extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=other)
$this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory, use this->picto=DOL_URL_ROOT.'/module/img/file.png'

View File

@ -49,7 +49,7 @@ class modPaypal extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "other";
$this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
@ -58,8 +58,6 @@ class modPaypal extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=other)
$this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory, use this->picto=DOL_URL_ROOT.'/module/img/file.png'

View File

@ -57,7 +57,6 @@ class modPrelevement extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
// Name of png file (without png) used for this module
$this->picto='payment';
@ -74,15 +73,15 @@ class modPrelevement extends DolibarrModules
// Constants
$this->const = array();
$r=0;
$this->const[$r][0] = "BANK_ADDON_PDF";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "sepamandate";
$this->const[$r][3] = 'Name of manager to generate SEPA mandate';
$this->const[$r][4] = 0;
$r++;
// Boxes
$this->boxes = array();
@ -129,11 +128,11 @@ class modPrelevement extends DolibarrModules
$this->rights[2][4] = 'bons';
$this->rights[2][5] = 'configurer';
*/
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
}
@ -155,7 +154,7 @@ class modPrelevement extends DolibarrModules
$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'bankaccount' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','bankaccount',".$conf->entity.")",
);
);
return $this->_init($sql,$options);
}

View File

@ -46,7 +46,7 @@ class modPrinting extends DolibarrModules
$this->numero = 64000;
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "technic";
$this->family = "interface";
$this->module_position = 520;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
@ -54,8 +54,6 @@ class modPrinting extends DolibarrModules
$this->description = "Enable Direct Printing System.";
$this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'

View File

@ -59,7 +59,6 @@ class modProduct extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='product';
// Data directories to create when module is enabled

View File

@ -47,7 +47,7 @@ class modProductBatch extends DolibarrModules
$this->family = "products";
$this->module_position = 45;
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Batch number, eat-by and sell-by date management module";
@ -56,7 +56,6 @@ class modProductBatch extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where dluo is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='stock';
@ -95,12 +94,12 @@ class modProductBatch extends DolibarrModules
$this->rights = array(); // Permission array used by this module
$r=0;
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
// Exports
$r=0;

View File

@ -58,7 +58,6 @@ class modProjet extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->config_page_url = array("project.php@projet");
$this->picto='project';

View File

@ -58,7 +58,6 @@ class modPropale extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='propal';
// Data directories to create when module is enabled
@ -101,13 +100,13 @@ class modPropale extends DolibarrModules
$this->const[$r][3] = "";
$this->const[$r][4] = 0;
$r++;
/*$this->const[$r][0] = "PROPALE_DRAFT_WATERMARK";
$this->const[$r][2] = "__(Draft)__";
$this->const[$r][3] = 'Watermark to show on draft proposals';
$this->const[$r][4] = 0;
$r++;*/
// Boxes
$this->boxes = array(
0=>array('file'=>'box_graph_propales_permonth.php','enabledbydefaulton'=>'Home'),
@ -170,12 +169,12 @@ class modPropale extends DolibarrModules
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'export';
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
// Exports
//--------
$r=0;

View File

@ -46,7 +46,7 @@ class modReceiptPrinter extends DolibarrModules
$this->numero = 67000;
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "technic";
$this->family = "interface";
$this->module_position = 530;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
@ -55,8 +55,6 @@ class modReceiptPrinter extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
$this->version = 'development';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'

View File

@ -69,9 +69,6 @@ class modResource extends DolibarrModules
// Key used in llx_const table to save module status enabled/disabled
// (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
// Where to store the module in setup page
// (0=common,1=interface,2=others,3=very specific)
$this->special = 2;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png
// use this->picto='pictovalue'

View File

@ -60,7 +60,6 @@ class modSalaries extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='bill';
// Data directories to create when module is enabled

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