Merge branch 'upstream/develop'
85
.scrutinizer.yml
Normal file
@ -0,0 +1,85 @@
|
||||
# .scrutinizer.yml
|
||||
imports:
|
||||
- javascript
|
||||
- php
|
||||
|
||||
filter:
|
||||
excluded_paths:
|
||||
- 'build/*'
|
||||
- 'dev/*'
|
||||
- 'doc/*'
|
||||
- 'test/*'
|
||||
- 'htdocs/includes/*'
|
||||
paths: { }
|
||||
|
||||
tools:
|
||||
# Similar code detection
|
||||
php_sim:
|
||||
enabled: true
|
||||
min_mass: 16
|
||||
filter:
|
||||
excluded_paths:
|
||||
- 'build/*'
|
||||
- 'dev/*'
|
||||
- 'doc/*'
|
||||
- 'test/*'
|
||||
- 'htdocs/includes/*'
|
||||
paths: { }
|
||||
|
||||
# php_depend
|
||||
php_pdepend:
|
||||
enabled: true
|
||||
configuration_file: null
|
||||
suffixes:
|
||||
- php
|
||||
excluded_dirs: { }
|
||||
filter:
|
||||
excluded_paths:
|
||||
- 'build/*'
|
||||
- 'dev/*'
|
||||
- 'doc/*'
|
||||
- 'test/*'
|
||||
- 'htdocs/includes/*'
|
||||
paths: { }
|
||||
|
||||
# php_analyzer
|
||||
php_analyzer:
|
||||
enabled: true
|
||||
extensions:
|
||||
- php
|
||||
dependency_paths: { }
|
||||
filter:
|
||||
excluded_paths:
|
||||
- 'build/*'
|
||||
- 'dev/*'
|
||||
- 'doc/*'
|
||||
- 'test/*'
|
||||
- 'htdocs/includes/*'
|
||||
paths: { }
|
||||
path_configs: { }
|
||||
|
||||
# change tracking
|
||||
php_changetracking:
|
||||
enabled: true
|
||||
bug_patterns:
|
||||
- '\bfix(?:es|ed)?\b'
|
||||
feature_patterns:
|
||||
- '\badd(?:s|ed)?\b'
|
||||
- '\bimplement(?:s|ed)?\b'
|
||||
filter:
|
||||
excluded_paths:
|
||||
- 'build/*'
|
||||
- 'dev/*'
|
||||
- 'doc/*'
|
||||
- 'test/*'
|
||||
- 'htdocs/includes/*'
|
||||
paths: { }
|
||||
|
||||
# Coding-Style / Bug Detection
|
||||
js_hint: true
|
||||
|
||||
|
||||
before_commands: { }
|
||||
after_commands: { }
|
||||
artifacts: { }
|
||||
build_failure_conditions: { }
|
||||
@ -50,6 +50,8 @@ For users:
|
||||
- Fix: Project Task numbering customs rule works.
|
||||
- Fix: Add actions events not implemented.
|
||||
- Fix: Price min of composition is not supplier price min by quantity
|
||||
- Fix: [ bug #1356 ] Bank accountancy number is limited to 8 numbers
|
||||
- New: Add categories translation
|
||||
|
||||
TODO
|
||||
- New: Predefined product and free product use same form.
|
||||
@ -73,6 +75,9 @@ For developers:
|
||||
- New: Normalize code for barcode generation to match other modules.
|
||||
- New: Uniformize code for contacts forms.
|
||||
- New: Add some hooks for financial reports.
|
||||
- New: A module can add its own ECM view.
|
||||
- New: A module can disable a standard ECM view.
|
||||
- New: Add multilang support into product webservice.
|
||||
|
||||
WARNING: Following change may create regression for some external modules, but was necessary to make
|
||||
Dolibarr better:
|
||||
@ -91,6 +96,10 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
|
||||
|
||||
***** ChangeLog for 3.5.3 compared to 3.5.2 *****
|
||||
Fix: Error on field accountancy code for export profile of invoices.
|
||||
Fix: [ bug #1351 ] VIES verification link broken.
|
||||
Fix: [ bug #1352 ] Removing a shipping does not remove the delivery.
|
||||
Fix: Option MAIN_INVERT_SENDER_RECIPIENT broken with typhon template.
|
||||
|
||||
|
||||
***** ChangeLog for 3.5.2 compared to 3.5.1 *****
|
||||
Fix: Can't add user for a task.
|
||||
|
||||
@ -369,6 +369,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.git*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.project`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.settings`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.scrutinizer.yml`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.travis.yml`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.tx`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build.xml`;
|
||||
|
||||
|
Before Width: | Height: | Size: 194 KiB |
BIN
doc/images/dolibarr_screenshot10_1280x800.png
Normal file
|
After Width: | Height: | Size: 218 KiB |
|
Before Width: | Height: | Size: 174 KiB |
|
Before Width: | Height: | Size: 210 KiB |
|
Before Width: | Height: | Size: 156 KiB |
BIN
doc/images/dolibarr_screenshot5_1280x800.png
Normal file
|
After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 131 KiB |
BIN
doc/images/dolibarr_screenshot7_1280x800.png
Normal file
|
After Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 161 KiB |
BIN
doc/images/dolibarr_screenshot8_1280x800.png
Normal file
|
After Width: | Height: | Size: 201 KiB |
@ -107,6 +107,9 @@ class Categorie extends CommonObject
|
||||
$this->fetch_optionals($this->id,$extralabels);
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
// multilangs
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) $this->getMultiLangs();
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -767,14 +770,21 @@ class Categorie extends CommonObject
|
||||
*/
|
||||
function get_full_arbo($type,$markafterid=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$this->cats = array();
|
||||
|
||||
// Init this->motherof that is array(id_son=>id_parent, ...)
|
||||
$this->load_motherof();
|
||||
$current_lang = $langs->getDefaultLang();
|
||||
|
||||
// Init $this->cats array
|
||||
$sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.fk_parent"; // Distinct reduce pb with old tables with duplicates
|
||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||
$sql.= ", t.label as label_trans, t.description as description_trans";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c";
|
||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
|
||||
$sql.= " WHERE c.entity IN (".getEntity('category',1).")";
|
||||
$sql.= " AND c.type = ".$type;
|
||||
|
||||
@ -788,8 +798,8 @@ class Categorie extends CommonObject
|
||||
$this->cats[$obj->rowid]['rowid'] = $obj->rowid;
|
||||
$this->cats[$obj->rowid]['id'] = $obj->rowid;
|
||||
$this->cats[$obj->rowid]['fk_parent'] = $obj->fk_parent;
|
||||
$this->cats[$obj->rowid]['label'] = $obj->label;
|
||||
$this->cats[$obj->rowid]['description'] = $obj->description;
|
||||
$this->cats[$obj->rowid]['label'] = ! empty($obj->label_trans) ? $obj->label_trans : $obj->label;
|
||||
$this->cats[$obj->rowid]['description'] = ! empty($obj->description_trans) ? $obj->description_trans : $obj->description;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
@ -1458,6 +1468,118 @@ class Categorie extends CommonObject
|
||||
$this->imgHeight = $infoImg[1]; // Hauteur de l'image
|
||||
}
|
||||
|
||||
/**
|
||||
* Update ou cree les traductions des infos produits
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function setMultiLangs()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$langs_available = $langs->get_available_languages();
|
||||
$current_lang = $langs->getDefaultLang();
|
||||
|
||||
foreach ($langs_available as $key => $value)
|
||||
{
|
||||
$sql = "SELECT rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_lang";
|
||||
$sql.= " WHERE fk_category=".$this->id;
|
||||
$sql.= " AND lang='".$key."'";
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
if ($key == $current_lang)
|
||||
{
|
||||
if ($this->db->num_rows($result)) // si aucune ligne dans la base
|
||||
{
|
||||
$sql2 = "UPDATE ".MAIN_DB_PREFIX."categorie_lang";
|
||||
$sql2.= " SET label='".$this->db->escape($this->label)."',";
|
||||
$sql2.= " description='".$this->db->escape($this->description)."'";
|
||||
$sql2.= " WHERE fk_category=".$this->id." AND lang='".$key."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."categorie_lang (fk_category, lang, label, description)";
|
||||
$sql2.= " VALUES(".$this->id.",'".$key."','". $this->db->escape($this->label);
|
||||
$sql2.= "','".$this->db->escape($this->multilangs["$key"]["description"])."')";
|
||||
}
|
||||
dol_syslog(get_class($this).'::setMultiLangs sql='.$sql2);
|
||||
if (! $this->db->query($sql2))
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog(get_class($this).'::setMultiLangs error='.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (isset($this->multilangs["$key"]))
|
||||
{
|
||||
if ($this->db->num_rows($result)) // si aucune ligne dans la base
|
||||
{
|
||||
$sql2 = "UPDATE ".MAIN_DB_PREFIX."categorie_lang";
|
||||
$sql2.= " SET label='".$this->db->escape($this->multilangs["$key"]["label"])."',";
|
||||
$sql2.= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'";
|
||||
$sql2.= " WHERE fk_category=".$this->id." AND lang='".$key."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."categorie_lang (fk_category, lang, label, description)";
|
||||
$sql2.= " VALUES(".$this->id.",'".$key."','". $this->db->escape($this->multilangs["$key"]["label"]);
|
||||
$sql2.= "','".$this->db->escape($this->multilangs["$key"]["description"])."')";
|
||||
}
|
||||
|
||||
// on ne sauvegarde pas des champs vides
|
||||
if ( $this->multilangs["$key"]["label"] || $this->multilangs["$key"]["description"] || $this->multilangs["$key"]["note"] )
|
||||
dol_syslog(get_class($this).'::setMultiLangs sql='.$sql2);
|
||||
if (! $this->db->query($sql2))
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog(get_class($this).'::setMultiLangs error='.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load array this->multilangs
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function getMultiLangs()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$current_lang = $langs->getDefaultLang();
|
||||
|
||||
$sql = "SELECT lang, label, description";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_lang";
|
||||
$sql.= " WHERE fk_category=".$this->id;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
while ( $obj = $this->db->fetch_object($result) )
|
||||
{
|
||||
//print 'lang='.$obj->lang.' current='.$current_lang.'<br>';
|
||||
if( $obj->lang == $current_lang ) // si on a les traduct. dans la langue courante on les charge en infos principales.
|
||||
{
|
||||
$this->label = $obj->label;
|
||||
$this->description = $obj->description;
|
||||
|
||||
}
|
||||
$this->multilangs["$obj->lang"]["label"] = $obj->label;
|
||||
$this->multilangs["$obj->lang"]["description"] = $obj->description;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$langs->trans("Error")." : ".$this->db->error()." - ".$sql;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialise an instance with random values.
|
||||
|
||||
@ -31,9 +31,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
$langs->load("categories");
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Security check
|
||||
$socid=GETPOST('socid','int');
|
||||
if (!$user->rights->categorie->lire) accessforbidden();
|
||||
@ -64,6 +61,9 @@ if ($catorigin && $type == 0) $idCatOrigin = $catorigin;
|
||||
|
||||
$object = new Categorie($db);
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -244,7 +244,7 @@ if ($user->rights->categorie->creer)
|
||||
print '<tr><td>'.$langs->trans("AddIn").'</td><td>';
|
||||
print $form->select_all_categories($type, $catorigin);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook))
|
||||
{
|
||||
|
||||
284
htdocs/categories/traduction.php
Normal file
@ -0,0 +1,284 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2010-2012 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/product/traduction.php
|
||||
* \ingroup product
|
||||
* \brief Page de traduction des produits
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
|
||||
$langs->load("categories");
|
||||
$langs->load("languages");
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$action=GETPOST('action','alpha');
|
||||
$cancel=GETPOST('cancel','alpha');
|
||||
$type=GETPOST('type');
|
||||
|
||||
// Security check
|
||||
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
|
||||
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
||||
|
||||
if ($id == "")
|
||||
{
|
||||
dol_print_error('','Missing parameter id');
|
||||
exit();
|
||||
}
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'categorie', $id, '&category');
|
||||
|
||||
$object = new Categorie($db);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// retour a l'affichage des traduction si annulation
|
||||
if ($cancel == $langs->trans("Cancel"))
|
||||
{
|
||||
$action = '';
|
||||
}
|
||||
|
||||
|
||||
// Validation de l'ajout
|
||||
if ($action == 'vadd' &&
|
||||
$cancel != $langs->trans("Cancel") &&
|
||||
($user->rights->categorie->creer ))
|
||||
{
|
||||
$object->fetch($id);
|
||||
$current_lang = $langs->getDefaultLang();
|
||||
|
||||
// update de l'objet
|
||||
if ( $_POST["forcelangprod"] == $current_lang )
|
||||
{
|
||||
$object->label = $_POST["libelle"];
|
||||
$object->description = dol_htmlcleanlastbr($_POST["desc"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"];
|
||||
$object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]);
|
||||
}
|
||||
|
||||
// sauvegarde en base
|
||||
if ( $object->setMultiLangs() > 0 )
|
||||
{
|
||||
$action = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$action = 'add';
|
||||
$mesg = '<div class="error">'.$object->error.'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Validation de l'edition
|
||||
if ($action == 'vedit' &&
|
||||
$cancel != $langs->trans("Cancel") &&
|
||||
($user->rights->categorie->creer))
|
||||
{
|
||||
$object->fetch($id);
|
||||
$current_lang = $langs->getDefaultLang();
|
||||
|
||||
foreach ( $object->multilangs as $key => $value ) // enregistrement des nouvelles valeurs dans l'objet
|
||||
{
|
||||
if ( $key == $current_lang )
|
||||
{
|
||||
$object->label = $_POST["libelle-".$key];
|
||||
$object->description = dol_htmlcleanlastbr($_POST["desc-".$key]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$object->multilangs[$key]["label"] = $_POST["libelle-".$key];
|
||||
$object->multilangs[$key]["description"] = dol_htmlcleanlastbr($_POST["desc-".$key]);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $object->setMultiLangs() > 0 )
|
||||
{
|
||||
$action = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$action = 'edit';
|
||||
$mesg = '<div class="error">'.$object->error.'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
$result = $object->fetch($id,$ref);
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader("","",$langs->trans("Translation"));
|
||||
|
||||
$form = new Form($db);
|
||||
$formadmin=new FormAdmin($db);
|
||||
|
||||
if ($type == 0) $title=$langs->trans("ProductsCategoryShort");
|
||||
elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort");
|
||||
elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort");
|
||||
elseif ($type == 3) $title=$langs->trans("MembersCategoryShort");
|
||||
elseif ($type == 4) $title=$langs->trans("ContactCategoriesShort");
|
||||
else $title=$langs->trans("Category");
|
||||
|
||||
$head = categories_prepare_head($object,$type);
|
||||
dol_fiche_head($head, 'translation', $title, 0, 'category');
|
||||
|
||||
if (! empty($mesg)) {
|
||||
dol_htmloutput_mesg($mesg);
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Reference
|
||||
print '<tr>';
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">';
|
||||
print $object->label;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
//WYSIWYG Editor
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="vedit">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
|
||||
if (! empty($object->multilangs))
|
||||
{
|
||||
foreach ($object->multilangs as $key => $value)
|
||||
{
|
||||
print "<br><b><u>".$langs->trans('Language_'.$key)." :</u></b><br>";
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td valign="top" width="15%" class="fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" size="40" value="'.$object->multilangs[$key]["label"].'"></td></tr>';
|
||||
print '<tr><td valign="top" width="15%">'.$langs->trans('Description').'</td><td>';
|
||||
$doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 3, 80);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<br /><center>';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$cnt_trans = 0;
|
||||
if (! empty($object->multilangs))
|
||||
{
|
||||
foreach ($object->multilangs as $key => $value)
|
||||
{
|
||||
$cnt_trans++;
|
||||
$s=picto_from_langcode($key);
|
||||
print "<br>".($s?$s.' ':'')." <b>".$langs->trans('Language_'.$key).":</b><br>";
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="15%">'.$langs->trans('Label').'</td><td>'.$object->multilangs[$key]["label"].'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans('Description').'</td><td>'.$object->multilangs[$key]["description"].'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans('Note').'</td><td>'.$object->multilangs[$key]["note"].'</td></tr>';
|
||||
print '</table>';
|
||||
}
|
||||
}
|
||||
if (! $cnt_trans) print '<br>'. $langs->trans('NoTranslation');
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Barre d'action */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
print "\n<div class=\"tabsAction\">\n";
|
||||
|
||||
if ($action == '')
|
||||
if ($user->rights->produit->creer || $user->rights->service->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'">'.$langs->trans("Add").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&id='.$object->id.'">'.$langs->trans("Update").'</a>';
|
||||
}
|
||||
|
||||
print "\n</div>\n";
|
||||
|
||||
|
||||
/*
|
||||
* Form to add a new translation
|
||||
*/
|
||||
|
||||
if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
{
|
||||
//WYSIWYG Editor
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
|
||||
print '<br>';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="vadd">';
|
||||
print '<input type="hidden" name="id" value="'.$_GET["id"].'">';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td valign="top" width="15%" class="fieldrequired">'.$langs->trans('Translation').'</td><td>';
|
||||
print $formadmin->select_language('','forcelangprod',0,$object->multilangs);
|
||||
print '</td></tr>';
|
||||
print '<tr><td valign="top" width="15%" class="fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" size="40"></td></tr>';
|
||||
print '<tr><td valign="top" width="15%">'.$langs->trans('Description').'</td><td>';
|
||||
$doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 3, 80);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
print '<br><center>';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
?>
|
||||
@ -179,8 +179,8 @@ $dolibarr_main_authentication='dolibarr';
|
||||
// Parameters used to setup LDAP authentication.
|
||||
// Uncomment them if dolibarr_main_authentication = 'ldap'
|
||||
//
|
||||
// $dolibarr_main_auth_ldap_host='127.0.0.1';
|
||||
// $dolibarr_main_auth_ldap_port='389';
|
||||
// $dolibarr_main_auth_ldap_host='127.0.0.1'; // You can define several servers here separated with a comma.
|
||||
// $dolibarr_main_auth_ldap_port='389'; // Port
|
||||
// $dolibarr_main_auth_ldap_version='3';
|
||||
// $dolibarr_main_auth_ldap_servertype='openldap'; // openldap, activedirectory or egroupware
|
||||
// $dolibarr_main_auth_ldap_login_attribute='loginfield'; // Ex: uid or samaccountname for active directory
|
||||
|
||||
@ -64,7 +64,7 @@ class box_factures_fourn extends ModeleBoxes
|
||||
if ($user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom, s.rowid as socid,";
|
||||
$sql.= " f.rowid as facid, f.ref_supplier, f.amount,";
|
||||
$sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.amount,";
|
||||
$sql.= " f.paye, f.fk_statut,";
|
||||
$sql.= ' f.datef as df,';
|
||||
$sql.= ' f.datec as datec,';
|
||||
@ -102,25 +102,29 @@ class box_factures_fourn extends ModeleBoxes
|
||||
'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid);
|
||||
|
||||
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
|
||||
'text' => $objp->ref_supplier,
|
||||
'text' => ($objp->ref?$objp->ref:$objp->facid),
|
||||
'text2'=> $late,
|
||||
'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid);
|
||||
|
||||
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
|
||||
$this->info_box_contents[$i][2] = array('td' => 'align="left"',
|
||||
'text' => $objp->ref_supplier,
|
||||
'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid);
|
||||
|
||||
$this->info_box_contents[$i][3] = array('td' => 'align="left" width="16"',
|
||||
'logo' => 'company',
|
||||
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
|
||||
|
||||
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
|
||||
$this->info_box_contents[$i][4] = array('td' => 'align="left"',
|
||||
'text' => $objp->nom,
|
||||
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
|
||||
|
||||
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
|
||||
$this->info_box_contents[$i][5] = array('td' => 'align="right"',
|
||||
'text' => dol_print_date($datec,'day'));
|
||||
|
||||
$fac = new FactureFournisseur($db);
|
||||
$fac->fetch($objp->facid);
|
||||
$alreadypaid=$fac->getSommePaiement();
|
||||
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
|
||||
$this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"',
|
||||
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3,$alreadypaid,$objp->type));
|
||||
|
||||
$i++;
|
||||
|
||||
@ -61,7 +61,7 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
if ($user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom, s.rowid as socid,";
|
||||
$sql.= " f.rowid as facid, f.ref_supplier, f.date_lim_reglement as datelimite,";
|
||||
$sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.date_lim_reglement as datelimite,";
|
||||
$sql.= " f.amount, f.datef as df,";
|
||||
$sql.= " f.paye, f.fk_statut, f.type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
@ -98,25 +98,29 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid);
|
||||
|
||||
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
|
||||
'text' => $objp->ref_supplier,
|
||||
'text' => ($objp->ref?$objp->ref:$objp->facid),
|
||||
'text2'=> $late,
|
||||
'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid);
|
||||
|
||||
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
|
||||
$this->info_box_contents[$i][2] = array('td' => 'align="left"',
|
||||
'text' => $objp->ref_supplier,
|
||||
'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid);
|
||||
|
||||
$this->info_box_contents[$i][3] = array('td' => 'align="left" width="16"',
|
||||
'logo' => 'company',
|
||||
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
|
||||
|
||||
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
|
||||
$this->info_box_contents[$i][4] = array('td' => 'align="left"',
|
||||
'text' => $objp->nom,
|
||||
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
|
||||
|
||||
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
|
||||
$this->info_box_contents[$i][5] = array('td' => 'align="right"',
|
||||
'text' => dol_print_date($datelimite,'day'));
|
||||
|
||||
$fac = new FactureFournisseur($db);
|
||||
$fac->fetch($objp->facid);
|
||||
$alreadypaid=$fac->getSommePaiement();
|
||||
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
|
||||
$this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"',
|
||||
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3,$alreadypaid,$objp->type));
|
||||
|
||||
$i++;
|
||||
|
||||
@ -47,8 +47,8 @@ abstract class CommonObject
|
||||
|
||||
public $array_options=array();
|
||||
|
||||
public $linkedObjectsIds;
|
||||
public $linkedObjects;
|
||||
public $linkedObjectsIds; // Loaded by ->fetchObjectLinked
|
||||
public $linkedObjects; // Loaded by ->fetchObjectLinked
|
||||
|
||||
// No constructor as it is an abstract class
|
||||
|
||||
@ -1718,7 +1718,7 @@ abstract class CommonObject
|
||||
* @param string $sourcetype Object source type
|
||||
* @param int $targetid Object target id
|
||||
* @param string $targettype Object target type
|
||||
* @param string $clause OR, AND clause
|
||||
* @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided
|
||||
* @return void
|
||||
*/
|
||||
function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR')
|
||||
@ -2392,7 +2392,8 @@ abstract class CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Function to check if an object is used by others
|
||||
* Function to check if an object is used by others.
|
||||
* Check is done into this->childtables. There is no check into llx_element_element.
|
||||
*
|
||||
* @param int $id Id of object
|
||||
* @return int <0 if KO, 0 if not used, >0 if already used
|
||||
|
||||
@ -225,22 +225,6 @@ class Conf
|
||||
if ($ret) $mc = new ActionsMulticompany($db);
|
||||
}
|
||||
|
||||
// Second or others levels object
|
||||
$this->propal->cloture = new stdClass();
|
||||
$this->propal->facturation = new stdClass();
|
||||
$this->commande->client = new stdClass();
|
||||
$this->commande->fournisseur = new stdClass();
|
||||
$this->facture->client = new stdClass();
|
||||
$this->facture->fournisseur = new stdClass();
|
||||
$this->fournisseur->commande = new stdClass();
|
||||
$this->fournisseur->facture = new stdClass();
|
||||
$this->contrat->services = new stdClass();
|
||||
$this->contrat->services->inactifs = new stdClass();
|
||||
$this->contrat->services->expires = new stdClass();
|
||||
$this->adherent->cotisation = new stdClass();
|
||||
$this->bank->rappro = new stdClass();
|
||||
$this->bank->cheque = new stdClass();
|
||||
|
||||
// Clean some variables
|
||||
if (empty($this->global->MAIN_MENU_STANDARD)) $this->global->MAIN_MENU_STANDARD="eldy_menu.php";
|
||||
if (empty($this->global->MAIN_MENUFRONT_STANDARD)) $this->global->MAIN_MENUFRONT_STANDARD="eldy_menu.php";
|
||||
|
||||
@ -424,16 +424,17 @@ class FormOther
|
||||
/**
|
||||
* Return list of project and tasks
|
||||
*
|
||||
* @param int $selectedtask Pre-selected task
|
||||
* @param int $projectid Project id
|
||||
* @param string $htmlname Name of html select
|
||||
* @param int $modeproject 1 to restrict on projects owned by user
|
||||
* @param int $modetask 1 to restrict on tasks associated to user
|
||||
* @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists
|
||||
* @param int $useempty 0=Allow empty values
|
||||
* @param int $selectedtask Pre-selected task
|
||||
* @param int $projectid Project id
|
||||
* @param string $htmlname Name of html select
|
||||
* @param int $modeproject 1 to restrict on projects owned by user
|
||||
* @param int $modetask 1 to restrict on tasks associated to user
|
||||
* @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists
|
||||
* @param int $useempty 0=Allow empty values
|
||||
* @param int $disablechildoftaskid 1=Disable task that are child of the provided task id
|
||||
* @return void
|
||||
*/
|
||||
function selectProjectTasks($selectedtask='', $projectid=0, $htmlname='task_parent', $modeproject=0, $modetask=0, $mode=0, $useempty=0)
|
||||
function selectProjectTasks($selectedtask='', $projectid=0, $htmlname='task_parent', $modeproject=0, $modetask=0, $mode=0, $useempty=0, $disablechildoftaskid=0)
|
||||
{
|
||||
global $user, $langs;
|
||||
|
||||
@ -448,7 +449,7 @@ class FormOther
|
||||
if ($useempty) print '<option value="0"> </option>';
|
||||
$j=0;
|
||||
$level=0;
|
||||
$this->_pLineSelect($j, 0, $tasksarray, $level, $selectedtask, $projectid);
|
||||
$this->_pLineSelect($j, 0, $tasksarray, $level, $selectedtask, $projectid, $disablechildoftaskid);
|
||||
print '</select>';
|
||||
}
|
||||
else
|
||||
@ -458,17 +459,18 @@ class FormOther
|
||||
}
|
||||
|
||||
/**
|
||||
* Write all lines of a project (if parent = 0)
|
||||
* Write lines of a project (all lines of a project if parent = 0)
|
||||
*
|
||||
* @param int &$inc Cursor counter
|
||||
* @param int $parent Id parent
|
||||
* @param Object $lines Line object
|
||||
* @param int $parent Id of parent task we want to see
|
||||
* @param array $lines Array of task lines
|
||||
* @param int $level Level
|
||||
* @param int $selectedtask Id selected task
|
||||
* @param int $selectedproject Id selected project
|
||||
* @param int $disablechildoftaskid 1=Disable task that are child of the provided task id
|
||||
* @return void
|
||||
*/
|
||||
private function _pLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0)
|
||||
private function _pLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0, $disablechildoftaskid=0)
|
||||
{
|
||||
global $langs, $user, $conf;
|
||||
|
||||
@ -481,12 +483,12 @@ class FormOther
|
||||
{
|
||||
$var = !$var;
|
||||
|
||||
//var_dump($selectedtask."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id);
|
||||
//var_dump($selectedproject."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id);
|
||||
|
||||
// Break on a new project
|
||||
if ($parent == 0)
|
||||
if ($parent == 0) // We are on a task at first level
|
||||
{
|
||||
if ($lines[$i]->fk_project != $lastprojectid)
|
||||
if ($lines[$i]->fk_project != $lastprojectid) // Break found on project
|
||||
{
|
||||
if ($i > 0 && $conf->browser->firefox) print '<option value="0" disabled="disabled">----------</option>';
|
||||
print '<option value="'.$lines[$i]->fk_project.'_0"';
|
||||
@ -509,11 +511,22 @@ class FormOther
|
||||
}
|
||||
}
|
||||
|
||||
$newdisablechildoftaskid=$disablechildoftaskid;
|
||||
|
||||
// Print task
|
||||
if ($lines[$i]->id >= 0)
|
||||
{
|
||||
// Check if we must disable entry
|
||||
$disabled=0;
|
||||
if ($disablechildoftaskid && (($lines[$i]->id == $disablechildoftaskid || $lines[$i]->fk_parent == $disablechildoftaskid)))
|
||||
{
|
||||
$disabled++;
|
||||
if ($lines[$i]->fk_parent == $disablechildoftaskid) $newdisablechildoftaskid=$lines[$i]->id; // If task is child of a disabled parent, we will propagate id to disable next child too
|
||||
}
|
||||
|
||||
print '<option value="'.$lines[$i]->fk_project.'_'.$lines[$i]->id.'"';
|
||||
if (($lines[$i]->id == $selectedtask) || ($lines[$i]->fk_project.'_'.$lines[$i]->id == $selectedtask)) print ' selected="selected"';
|
||||
if ($disabled) print ' disabled="disabled"';
|
||||
print '>';
|
||||
print $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
if (empty($lines[$i]->public))
|
||||
@ -534,7 +547,7 @@ class FormOther
|
||||
}
|
||||
|
||||
$level++;
|
||||
if ($lines[$i]->id) $this->_pLineSelect($inc, $lines[$i]->id, $lines, $level, $selectedtask, $selectedproject);
|
||||
if ($lines[$i]->id) $this->_pLineSelect($inc, $lines[$i]->id, $lines, $level, $selectedtask, $selectedproject, $newdisablechildoftaskid);
|
||||
$level--;
|
||||
}
|
||||
}
|
||||
@ -1042,7 +1055,7 @@ class FormOther
|
||||
$emptybox->showBox(array(),array());
|
||||
}
|
||||
print "</div>\n";
|
||||
print "<!-- End box container -->\n";
|
||||
print "<!-- End box left container -->\n";
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
@ -1073,7 +1086,7 @@ class FormOther
|
||||
$emptybox->showBox(array(),array());
|
||||
}
|
||||
print "</div>\n";
|
||||
print "<!-- End box container -->\n";
|
||||
print "<!-- End box right container -->\n";
|
||||
|
||||
print '</div></div>';
|
||||
print "\n";
|
||||
|
||||
@ -128,7 +128,7 @@ class Ldap
|
||||
$this->attr_firstname = $conf->global->LDAP_FIELD_FIRSTNAME;
|
||||
$this->attr_mail = $conf->global->LDAP_FIELD_MAIL;
|
||||
$this->attr_phone = $conf->global->LDAP_FIELD_PHONE;
|
||||
$this->attr_skype = $conf->global->LDAP_FIELD_SKYPE;
|
||||
$this->attr_skype = $conf->global->LDAP_FIELD_SKYPE;
|
||||
$this->attr_fax = $conf->global->LDAP_FIELD_FAX;
|
||||
$this->attr_mobile = $conf->global->LDAP_FIELD_MOBILE;
|
||||
}
|
||||
@ -151,9 +151,19 @@ class Ldap
|
||||
$connected=0;
|
||||
$this->bind=0;
|
||||
|
||||
// Check parameters
|
||||
if (count($this->server) == 0 || empty($this->server[0]))
|
||||
{
|
||||
$this->error='LDAP setup (file conf.php) is not complete';
|
||||
$return=-1;
|
||||
dol_syslog(get_class($this)."::connect_bind ".$this->error, LOG_WARNING);
|
||||
}
|
||||
|
||||
// Loop on each ldap server
|
||||
foreach ($this->server as $key => $host)
|
||||
{
|
||||
if ($connected) break;
|
||||
if (empty($host)) continue;
|
||||
|
||||
if (preg_match('/^ldap/',$host))
|
||||
{
|
||||
@ -171,7 +181,7 @@ class Ldap
|
||||
if ($this->serverType == "activedirectory")
|
||||
{
|
||||
$result=$this->setReferrals();
|
||||
dol_syslog(get_class($this)."::connect_bind try bindauth for activedirectory on ".$host." user=".$this->searchUser,LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::connect_bind try bindauth for activedirectory on ".$host." user=".$this->searchUser." password=".preg_replace('/./','*',$this->searchPassword),LOG_DEBUG);
|
||||
$this->result=$this->bindauth($this->searchUser,$this->searchPassword);
|
||||
if ($this->result)
|
||||
{
|
||||
@ -189,7 +199,7 @@ class Ldap
|
||||
// Try in auth mode
|
||||
if ($this->searchUser && $this->searchPassword)
|
||||
{
|
||||
dol_syslog(get_class($this)."::connect_bind try bindauth on ".$host." user=".$this->searchUser,LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::connect_bind try bindauth on ".$host." user=".$this->searchUser." password=".preg_replace('/./','*',$this->searchPassword),LOG_DEBUG);
|
||||
$this->result=$this->bindauth($this->searchUser,$this->searchPassword);
|
||||
if ($this->result)
|
||||
{
|
||||
|
||||
@ -59,7 +59,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
|
||||
$("#'.$htmlname.'").trigger("change");
|
||||
});
|
||||
// Check when keyup
|
||||
$("input#search_'.$htmlname.'").onDelayedKeyup({ handler: function() {
|
||||
$("input#search_'.$htmlname.'").keyup(function() {
|
||||
//console.log(\'keyup\');
|
||||
if ($(this).val().length == 0)
|
||||
{
|
||||
@ -93,7 +93,6 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$("input#search_'.$htmlname.'").autocomplete({
|
||||
source: function( request, response ) {
|
||||
@ -366,7 +365,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0)
|
||||
$("select#" + htmlname).html(response.value);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});'."\n";
|
||||
$msg.= "</script>\n";
|
||||
|
||||
|
||||
@ -47,6 +47,11 @@ function categories_prepare_head($object,$type)
|
||||
$head[$h][1] = $langs->trans("Photos");
|
||||
$head[$h][2] = 'photos';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/categories/traduction.php?id='.$object->id.'&type='.$type;
|
||||
$head[$h][1] = $langs->trans("Translation");
|
||||
$head[$h][2] = 'translation';
|
||||
$h++;
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -23,6 +23,43 @@
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Prepare array with list of different ecm main dashboard
|
||||
*
|
||||
* @param object $object Object related to tabs
|
||||
* @return array Array of tabs to shoc
|
||||
*/
|
||||
function ecm_prepare_dasboard_head($object)
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/ecm/index.php';
|
||||
$head[$h][1] = $langs->trans("ECMSectionsManual").img_help(1,$helptext1);
|
||||
$head[$h][2] = 'index';
|
||||
$h++;
|
||||
|
||||
if (! empty($conf->global->ECM_AUTO_TREE_ENABLED))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT.'/ecm/index_auto.php';
|
||||
$head[$h][1] = $langs->trans("ECMSectionsAuto").img_help(1,$helptext2);
|
||||
$head[$h][2] = 'index_auto';
|
||||
$h++;
|
||||
}
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'ecm');
|
||||
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'ecm','remove');
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prepare array with list of tabs
|
||||
*
|
||||
|
||||
@ -581,7 +581,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='
|
||||
* @param array $links Array of tabs
|
||||
* @param string $active Active tab name (document', 'info', 'ldap', ....)
|
||||
* @param string $title Title
|
||||
* @param int $notab 0=Add tab header, 1=no tab header
|
||||
* @param int $notab 0=Add tab header, 1=no tab header. If you set this to 1, using dol_fiche_end() to close tab is not required.
|
||||
* @param string $picto Add a picto on tab title
|
||||
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
|
||||
* @return void
|
||||
@ -597,7 +597,7 @@ function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto
|
||||
* @param array $links Array of tabs
|
||||
* @param int $active Active tab name
|
||||
* @param string $title Title
|
||||
* @param int $notab 0=Add tab header, 1=no tab header
|
||||
* @param int $notab 0=Add tab header, 1=no tab header. If you set this to 1, using dol_fiche_end() to close tab is not required.
|
||||
* @param string $picto Add a picto on tab title
|
||||
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
|
||||
* @return void
|
||||
@ -4333,6 +4333,7 @@ function picto_from_langcode($codelang)
|
||||
* 'group' to add a tab in group view
|
||||
* 'member' to add a tab in fundation member view
|
||||
* 'categories_x' to add a tab in category view ('x': type of category (0=product, 1=supplier, 2=customer, 3=member)
|
||||
* 'ecm' to add a tab for another ecm view
|
||||
* @param string $mode 'add' to complete head, 'remove' to remove entries
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@ -1532,3 +1532,126 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clean corrupted tree (orphelins linked to a not existing parent), record linked to themself and child-parent loop
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $tabletocleantree Table to clean
|
||||
* @param string $fieldfkparent Field name that contains id of parent
|
||||
* @return int Nb of records fixed/deleted
|
||||
*/
|
||||
function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent)
|
||||
{
|
||||
$totalnb=0;
|
||||
$listofid=array();
|
||||
$listofparentid=array();
|
||||
|
||||
// Get list of all id in array listofid and all parents in array listofparentid
|
||||
$sql='SELECT rowid, '.$fieldfkparent.' as parent_id FROM '.MAIN_DB_PREFIX.$tabletocleantree;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$listofid[]=$obj->rowid;
|
||||
if ($obj->parent_id > 0) $listofparentid[$obj->rowid]=$obj->parent_id;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if (count($listofid))
|
||||
{
|
||||
print 'Code requested to clean tree (may be to solve data corruption), so we check/clean orphelins and loops.'."<br>\n";
|
||||
|
||||
// Check loops on each other
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabletocleantree." SET ".$fieldfkparent." = 0 WHERE ".$fieldfkparent." = rowid"; // So we update only records linked to themself
|
||||
dol_syslog("sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$nb=$db->affected_rows($sql);
|
||||
if ($nb > 0)
|
||||
{
|
||||
print '<br>Some record that were parent of themself were cleaned.';
|
||||
}
|
||||
|
||||
$totalnb+=$nb;
|
||||
}
|
||||
//else dol_print_error($db);
|
||||
|
||||
// Check other loops
|
||||
$listofidtoclean=array();
|
||||
foreach($listofparentid as $id => $pid)
|
||||
{
|
||||
// Check depth
|
||||
//print 'Analyse record id='.$id.' with parent '.$pid.'<br>';
|
||||
|
||||
$cursor=$id; $arrayidparsed=array(); // We start from child $id
|
||||
while ($cursor > 0)
|
||||
{
|
||||
$arrayidparsed[$cursor]=1;
|
||||
if ($arrayidparsed[$listofparentid[$cursor]]) // We detect a loop. A record with a parent that was already into child
|
||||
{
|
||||
print 'Found a loop between id '.$id.' - '.$cursor.'<br>';
|
||||
unset($arrayidparsed);
|
||||
$listofidtoclean[$cursor]=$id;
|
||||
break;
|
||||
}
|
||||
$cursor=$listofparentid[$cursor];
|
||||
}
|
||||
|
||||
if (count($listofidtoclean)) break;
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabletocleantree;
|
||||
$sql.= " SET ".$fieldfkparent." = 0";
|
||||
$sql.= " WHERE rowid IN (".join(',',$listofidtoclean).")"; // So we update only records detected wrong
|
||||
dol_syslog("sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$nb=$db->affected_rows($sql);
|
||||
if ($nb > 0)
|
||||
{
|
||||
// Removed orphelins records
|
||||
print '<br>Some records were detected to have parent that is a child, we set them as root record for id: ';
|
||||
print join(',',$listofidtoclean);
|
||||
}
|
||||
|
||||
$totalnb+=$nb;
|
||||
}
|
||||
//else dol_print_error($db);
|
||||
|
||||
// Check and clean orphelins
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabletocleantree;
|
||||
$sql.= " SET ".$fieldfkparent." = 0";
|
||||
$sql.= " WHERE ".$fieldfkparent." NOT IN (".join(',',$listofid).")"; // So we update only records linked to a non existing parent
|
||||
dol_syslog("sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$nb=$db->affected_rows($sql);
|
||||
if ($nb > 0)
|
||||
{
|
||||
// Removed orphelins records
|
||||
print '<br>Some orphelins were found and modified to be parent so records are visible again for id: ';
|
||||
print join(',',$listofid);
|
||||
}
|
||||
|
||||
$totalnb+=$nb;
|
||||
}
|
||||
//else dol_print_error($db);
|
||||
|
||||
print '<br>We fixed '.$totalnb.' record(s). Some records may still be corrupted. New check may be required.';
|
||||
return $totalnb;
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
|
||||
$ldap=new Ldap();
|
||||
$ldap->server=array($ldaphost);
|
||||
$ldap->server=explode(',',$ldaphost);
|
||||
$ldap->serverPort=$ldapport;
|
||||
$ldap->ldapProtocolVersion=$ldapversion;
|
||||
$ldap->serverType=$ldapservertype;
|
||||
@ -140,7 +140,7 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
|
||||
$result=$ldap->connect_bind();
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($result == 2)
|
||||
if ($result == 2) // Connection is ok for user/pass into LDAP
|
||||
{
|
||||
dol_syslog("functions_ldap::check_user_password_ldap Authentification ok");
|
||||
$login=$usertotest;
|
||||
@ -168,22 +168,22 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
|
||||
{
|
||||
dol_syslog("functions_ldap::check_user_password_ldap Sync user found id=".$user->id);
|
||||
// On verifie si le login a change et on met a jour les attributs dolibarr
|
||||
|
||||
|
||||
if ($conf->multicompany->enabled) {
|
||||
global $mc;
|
||||
|
||||
global $mc;
|
||||
|
||||
$ret=$mc->checkRight($user->id, $entitytotest);
|
||||
if ($ret < 0) $login=false; // provoque l'echec de l'identification
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($user->login != $ldap->login && $ldap->login)
|
||||
{
|
||||
$user->login = $ldap->login;
|
||||
$user->update($user);
|
||||
// TODO Que faire si update echoue car on update avec un login deja existant.
|
||||
}
|
||||
|
||||
|
||||
//$resultUpdate = $user->update_ldap2dolibarr($ldap);
|
||||
}
|
||||
}
|
||||
@ -212,12 +212,13 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
|
||||
{
|
||||
$ldap->ldapErrorCode = ldap_errno($ldap->connection);
|
||||
$ldap->ldapErrorText = ldap_error($ldap->connection);
|
||||
dol_syslog("functions_ldap::check_user_password_ldap ".$ldap->ldapErrorText);
|
||||
dol_syslog("functions_ldap::check_user_password_ldap ".$ldap->ldapErrorCode." ".$ldap->ldapErrorText);
|
||||
}
|
||||
sleep(1);
|
||||
$langs->load('main');
|
||||
$langs->load('other');
|
||||
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword");
|
||||
$langs->load('errors');
|
||||
$_SESSION["dol_loginmesg"]=($ldap->error?$ldap->error:$langs->trans("ErrorBadLoginPassword"));
|
||||
}
|
||||
|
||||
$ldap->close();
|
||||
|
||||
@ -780,9 +780,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
|
||||
// Client destinataire
|
||||
$posy=42;
|
||||
$posx=102;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY(102,$posy-5);
|
||||
$pdf->SetXY($posx,$posy-5);
|
||||
$pdf->MultiCell(80,5, $outputlangs->transnoentities("DeliveryAddress").":", 0, 'L');
|
||||
|
||||
// If SHIPPING contact defined on order, we use it
|
||||
@ -814,7 +816,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
|
||||
$posy=42;
|
||||
$posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
|
||||
//if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
|
||||
// Show recipient frame
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
@ -63,7 +63,7 @@ class modCategorie extends DolibarrModules
|
||||
$this->depends = array();
|
||||
|
||||
// Config pages
|
||||
$this->config_page_url = array('/categories/admin/categorie.php');
|
||||
$this->config_page_url = array('categorie.php@categories');
|
||||
$this->langfiles = array("products","companies","categories");
|
||||
|
||||
// Constantes
|
||||
|
||||
@ -74,13 +74,13 @@ class modECM extends DolibarrModules
|
||||
// Constants
|
||||
$this->const = array(); // List of parameters
|
||||
$r=0;
|
||||
|
||||
|
||||
$this->const[$r][0] = "ECM_AUTO_TREE_ENABLED";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "1";
|
||||
$this->const[$r][3] = 'Auto tree is enabled by default';
|
||||
$this->const[$r][4] = 0;
|
||||
|
||||
|
||||
// Boxes
|
||||
$this->boxes = array(); // List of boxes
|
||||
$r=0;
|
||||
@ -138,11 +138,12 @@ class modECM extends DolibarrModules
|
||||
$r++;
|
||||
|
||||
// Left menu linked to top menu
|
||||
$this->menu[$r]=array('fk_menu'=>'r=0',
|
||||
$this->menu[$r]=array('fk_menu'=>'fk_mainmenu=ecm',
|
||||
'type'=>'left',
|
||||
'titre'=>'ECMArea',
|
||||
'mainmenu'=>'ecm',
|
||||
'url'=>'/ecm/index.php',
|
||||
'leftmenu'=>'ecm',
|
||||
'url'=>'/ecm/index.php?mainmenu=ecm&leftmenu=ecm',
|
||||
'langs'=>'ecm',
|
||||
'position'=>101,
|
||||
'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
|
||||
@ -151,24 +152,12 @@ class modECM extends DolibarrModules
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
|
||||
$this->menu[$r]=array('fk_menu'=>'r=1',
|
||||
$this->menu[$r]=array('fk_menu'=>'fk_mainmenu=ecm,fk_leftmenu=ecm',
|
||||
'type'=>'left',
|
||||
'titre'=>'ECMNewSection',
|
||||
'titre'=>'ECMSectionsManual',
|
||||
'mainmenu'=>'ecm',
|
||||
'url'=>'/ecm/docdir.php?action=create',
|
||||
'langs'=>'ecm',
|
||||
'position'=>100,
|
||||
'perms'=>'$user->rights->ecm->setup',
|
||||
'enabled'=>'$user->rights->ecm->setup',
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
|
||||
$this->menu[$r]=array('fk_menu'=>'r=1',
|
||||
'type'=>'left',
|
||||
'titre'=>'ECMFileManager',
|
||||
'mainmenu'=>'ecm',
|
||||
'url'=>'/ecm/index.php?action=file_manager',
|
||||
'leftmenu'=>'ecm_manual',
|
||||
'url'=>'/ecm/index.php?action=file_manager&mainmenu=ecm&leftmenu=ecm',
|
||||
'langs'=>'ecm',
|
||||
'position'=>102,
|
||||
'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
|
||||
@ -177,21 +166,18 @@ class modECM extends DolibarrModules
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
|
||||
/*
|
||||
$this->menu[$r]=array('fk_menu'=>'r=1',
|
||||
$this->menu[$r]=array('fk_menu'=>'fk_mainmenu=ecm,fk_leftmenu=ecm',
|
||||
'type'=>'left',
|
||||
'titre'=>'Search',
|
||||
'titre'=>'ECMSectionsAuto',
|
||||
'mainmenu'=>'ecm',
|
||||
'url'=>'/ecm/search.php',
|
||||
'url'=>'/ecm/index_auto.php?action=file_manager&mainmenu=ecm&leftmenu=ecm',
|
||||
'langs'=>'ecm',
|
||||
'position'=>103,
|
||||
'perms'=>'$user->rights->ecm->read',
|
||||
'enabled'=>'$user->rights->ecm->read',
|
||||
'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
|
||||
'enabled'=>'$user->rights->ecm->read || $user->rights->ecm->upload',
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
|
||||
$r++;*/
|
||||
|
||||
$r++;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -61,7 +61,7 @@ $(document).ready(function () {
|
||||
<input type="hidden" name="dol_no_mouse_hover" id="dol_no_mouse_hover" value="<?php echo $dol_no_mouse_hover; ?>" />
|
||||
<input type="hidden" name="dol_use_jmobile" id="dol_use_jmobile" value="<?php echo $dol_use_jmobile; ?>" />
|
||||
|
||||
<table class="login_table_title" summary="<?php echo dol_escape_htmltag($title); ?>" align="center">
|
||||
<table class="login_table_title center" summary="<?php echo dol_escape_htmltag($title); ?>">
|
||||
<tr class="vmenu"><td align="center"><?php echo $title; ?></td></tr>
|
||||
</table>
|
||||
<br>
|
||||
@ -72,7 +72,7 @@ $(document).ready(function () {
|
||||
|
||||
<div id="login_left">
|
||||
|
||||
<table class="left" summary="Login pass" cellpadding="2">
|
||||
<table class="left" summary="Login pass">
|
||||
<!-- Login -->
|
||||
<tr>
|
||||
<td valign="middle" class="loginfield"><strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong></td>
|
||||
@ -190,9 +190,9 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file
|
||||
<?php if (! empty($_SESSION['dol_loginmesg']))
|
||||
{
|
||||
?>
|
||||
<center><div align="center" style="max-width: 500px; margin-left: 10px; margin-right: 10px;"><div class="error">
|
||||
<div class="center" style="max-width: 500px; margin-left: 10px; margin-right: 10px;"><div class="error">
|
||||
<?php echo $_SESSION['dol_loginmesg']; ?>
|
||||
</div></div></center>
|
||||
</div></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
@ -200,9 +200,9 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file
|
||||
<?php if ($main_home)
|
||||
{
|
||||
?>
|
||||
<center><div align="center" class="login_main_home" style="max-width: 80%">
|
||||
<div class="center" class="login_main_home" style="max-width: 80%">
|
||||
<?php echo $main_home; ?>
|
||||
</div></center><br>
|
||||
</div><br>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
@ -521,8 +521,7 @@ $(document).ready(function() {
|
||||
});
|
||||
});
|
||||
<?php } else { ?>
|
||||
$('#product_desc').onDelayedKeyup({
|
||||
'handler': function() {
|
||||
$('#product_desc').keyup(function() {
|
||||
var addline=false;
|
||||
if ($('#idprod').val() == 0 && $('#select_type').val() >= 0 && $('#price_ht').val().length > 0) {
|
||||
var content = $('#product_desc').val();
|
||||
@ -537,7 +536,6 @@ $(document).ready(function() {
|
||||
} else {
|
||||
$('#addlinebutton').attr('disabled','disabled');
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
|
||||
@ -348,8 +348,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 1) // TODO A virer
|
||||
});
|
||||
});
|
||||
<?php } else { ?>
|
||||
$('#product_desc').onDelayedKeyup({
|
||||
'handler': function() {
|
||||
$('#product_desc').keyup(function() {
|
||||
var addline=false;
|
||||
if ($('#product_id').val() == 0 && $('#select_type').val() >= 0 && $('#price_ht').val().length > 0) {
|
||||
var content = $('#product_desc').val();
|
||||
@ -364,7 +363,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 1) // TODO A virer
|
||||
} else {
|
||||
$('#savelinebutton').attr('disabled','disabled');
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ $(document).ready(function () {
|
||||
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
|
||||
<input type="hidden" name="action" value="buildnewpassword">
|
||||
|
||||
<table class="login_table_title" summary="<?php echo dol_escape_htmltag($title); ?>" align="center">
|
||||
<table class="login_table_title center" summary="<?php echo dol_escape_htmltag($title); ?>">
|
||||
<tr class="vmenu"><td align="center"><?php echo $title; ?></td></tr>
|
||||
</table>
|
||||
<br>
|
||||
@ -57,7 +57,7 @@ $(document).ready(function () {
|
||||
|
||||
<div id="login_left">
|
||||
|
||||
<table class="left" summary="Login pass" cellpadding="2">
|
||||
<table class="left" summary="Login pass">
|
||||
|
||||
<!-- Login -->
|
||||
<tr>
|
||||
@ -129,7 +129,7 @@ if (! empty($hookmanager->resArray['options'])) {
|
||||
</form>
|
||||
|
||||
|
||||
<center><div align="center" style="max-width: 680px; margin-left: 10px; margin-right: 10px;">
|
||||
<div class="center" style="max-width: 680px; margin-left: 10px; margin-right: 10px;">
|
||||
<?php if ($mode == 'dolibarr' || ! $disabled) { ?>
|
||||
<font style="font-size: 12px;">
|
||||
<?php echo $langs->trans('SendNewPasswordDesc'); ?>
|
||||
@ -139,15 +139,15 @@ if (! empty($hookmanager->resArray['options'])) {
|
||||
<?php echo $langs->trans('AuthenticationDoesNotAllowSendNewPassword', $mode); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div></center>
|
||||
</div>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
<?php if ($message) { ?>
|
||||
<center><div align="center" style="max-width: 680px; margin-left: 10px; margin-right: 10px;">
|
||||
<div class="center" style="max-width: 680px; margin-left: 10px; margin-right: 10px;">
|
||||
<?php echo dol_htmloutput_mesg($message,'','',1); ?>
|
||||
</div></center>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</center> <!-- end of center -->
|
||||
|
||||
@ -346,8 +346,10 @@ if ($action == 'refreshmanual')
|
||||
* View
|
||||
*/
|
||||
|
||||
//print "xx".$_SESSION["dol_screenheight"];
|
||||
$maxheightwin=(isset($_SESSION["dol_screenheight"]) && $_SESSION["dol_screenheight"] > 500)?($_SESSION["dol_screenheight"]-166):660;
|
||||
// Define height of file area (depends on $_SESSION["dol_screenheight"])
|
||||
//print $_SESSION["dol_screenheight"];
|
||||
$maxheightwin=(isset($_SESSION["dol_screenheight"]) && $_SESSION["dol_screenheight"] > 466)?($_SESSION["dol_screenheight"]-186):660; // Also into index_auto.php file
|
||||
|
||||
$morejs=array();
|
||||
if (empty($conf->global->MAIN_ECM_DISABLE_JS)) $morejs=array("/includes/jquery/plugins/jqueryFileTree/jqueryFileTree.js");
|
||||
$moreheadcss="
|
||||
@ -417,11 +419,19 @@ if (! empty($conf->global->ECM_AUTO_TREE_ENABLED))
|
||||
|
||||
print_fiche_titre($langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager"));
|
||||
|
||||
$helptext1=''; $helptext2='';
|
||||
$helptext1.=$langs->trans("ECMAreaDesc");
|
||||
$helptext1.=$langs->trans("ECMAreaDesc2");
|
||||
$helptext2.=$langs->trans("ECMAreaDesc");
|
||||
$helptext2.=$langs->trans("ECMAreaDesc2");
|
||||
|
||||
/*
|
||||
print '<div class="hideonsmartphone">';
|
||||
print $langs->trans("ECMAreaDesc")."<br>";
|
||||
print $langs->trans("ECMAreaDesc2")."<br>";
|
||||
print "<br>\n";
|
||||
print '</div>';
|
||||
*/
|
||||
|
||||
// Confirm remove file (for non javascript users)
|
||||
if ($action == 'delete' && empty($conf->use_javascript_ajax))
|
||||
@ -436,6 +446,13 @@ dol_htmloutput_mesg($mesg);
|
||||
if (! empty($conf->use_javascript_ajax)) $classviewhide='hidden';
|
||||
else $classviewhide='visible';
|
||||
|
||||
|
||||
if (empty($conf->dol_use_jmobile))
|
||||
{
|
||||
$head = ecm_prepare_dasboard_head('');
|
||||
dol_fiche_head($head, 'index', '', 1, '');
|
||||
}
|
||||
|
||||
// Start container of all panels
|
||||
?>
|
||||
<div id="containerlayout"> <!-- begin div id="containerlayout" -->
|
||||
@ -492,75 +509,6 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
|
||||
print '</td></tr>';
|
||||
|
||||
$showonrightsize='';
|
||||
// Auto section
|
||||
if (count($sectionauto))
|
||||
{
|
||||
$htmltooltip=$langs->trans("ECMAreaDesc2");
|
||||
|
||||
// Root title line (Automatic section)
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print '<table class="nobordernopadding"><tr class="nobordernopadding">';
|
||||
print '<td align="left" width="24">';
|
||||
print img_picto_common('','treemenu/base.gif');
|
||||
print '</td><td align="left">';
|
||||
$txt=$langs->trans("ECMRoot").' ('.$langs->trans("ECMSectionsAuto").')';
|
||||
print $form->textwithpicto($txt, $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
print '</tr></table>';
|
||||
print '</td>';
|
||||
print '<td align="right"> </td>';
|
||||
print '<td align="right"> </td>';
|
||||
print '<td align="right"> </td>';
|
||||
print '<td align="right"> </td>';
|
||||
print '<td align="center">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$sectionauto=dol_sort_array($sectionauto,'label','ASC',true,false);
|
||||
|
||||
print '<tr>';
|
||||
print '<td colspan="6" style="padding-left: 20px">';
|
||||
print '<div id="filetreeauto" class="ecmfiletree"><ul class="ecmjqft">';
|
||||
|
||||
$nbofentries=0;
|
||||
$oldvallevel=0;
|
||||
foreach ($sectionauto as $key => $val)
|
||||
{
|
||||
if (empty($val['test'])) continue; // If condition to show is ok
|
||||
|
||||
$var=false;
|
||||
|
||||
print '<li class="directory collapsed">';
|
||||
if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))
|
||||
{
|
||||
print '<a class="fmdirlia jqft ecmjqft" href="'.DOL_URL_ROOT.'/ecm/index.php?module='.$val['module'].'">';
|
||||
print $val['label'];
|
||||
print '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="fmdirlia jqft ecmjqft" href="'.DOL_URL_ROOT.'/ecm/index.php?module='.$val['module'].'">';
|
||||
print $val['label'];
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
print '<div class="ecmjqft">';
|
||||
// Info
|
||||
$htmltooltip='<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
|
||||
$htmltooltip='<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionAuto").'<br>';
|
||||
$htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$langs->trans("ECMTypeAuto").'<br>';
|
||||
$htmltooltip.='<b>'.$langs->trans("Description").'</b>: '.$val['desc'];
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</div>';
|
||||
print '</li>';
|
||||
|
||||
$nbofentries++;
|
||||
}
|
||||
|
||||
print '</ul></div></td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Manual section
|
||||
$htmltooltip=$langs->trans("ECMAreaDesc2");
|
||||
@ -768,7 +716,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
|
||||
}
|
||||
|
||||
|
||||
// End left banner
|
||||
// End left panel
|
||||
?>
|
||||
</div>
|
||||
<div id="ecm-layout-center" class="<?php echo $classviewhide; ?>">
|
||||
@ -806,7 +754,7 @@ if ((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABL
|
||||
}
|
||||
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/ecm/index.php', 'none', 0, ($section?$section:-1), $user->rights->ecm->upload, 48, null, '', 0, '', 0, 'formuserfile');
|
||||
$formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section?$section:-1), $user->rights->ecm->upload, 48, null, '', 0, '', 0, 'formuserfile');
|
||||
}
|
||||
else print ' ';
|
||||
|
||||
@ -821,9 +769,11 @@ else print ' ';
|
||||
// End of page
|
||||
|
||||
|
||||
//dol_fiche_end();
|
||||
|
||||
|
||||
if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) {
|
||||
include 'tpl/builddatabase.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php';
|
||||
}
|
||||
|
||||
|
||||
|
||||
605
htdocs/ecm/index_auto.php
Normal file
@ -0,0 +1,605 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/ecm/index_auto.php
|
||||
* \ingroup ecm
|
||||
* \brief Main page for ECM section area
|
||||
* \author Laurent Destailleur
|
||||
*/
|
||||
|
||||
if (! defined('REQUIRE_JQUERY_LAYOUT')) define('REQUIRE_JQUERY_LAYOUT','1');
|
||||
if (! defined('REQUIRE_JQUERY_BLOCKUI')) define('REQUIRE_JQUERY_BLOCKUI', 1);
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
|
||||
|
||||
// Load traductions files
|
||||
$langs->load("ecm");
|
||||
$langs->load("companies");
|
||||
$langs->load("other");
|
||||
$langs->load("users");
|
||||
$langs->load("orders");
|
||||
$langs->load("propal");
|
||||
$langs->load("bills");
|
||||
$langs->load("contracts");
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'ecm', 0);
|
||||
|
||||
// Get parameters
|
||||
$socid=GETPOST('socid','int');
|
||||
$action=GETPOST("action");
|
||||
$section=GETPOST("section")?GETPOST("section","int"):GETPOST("section_id","int");
|
||||
$module=GETPOST("module");
|
||||
if (! $section) $section=0;
|
||||
$section_dir=GETPOST('section_dir');
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="fullname";
|
||||
if ($module == 'invoice_supplier' && $sortfield == "fullname") $sortfield="level1name";
|
||||
|
||||
$ecmdir = new EcmDirectory($db);
|
||||
if ($section)
|
||||
{
|
||||
$result=$ecmdir->fetch($section);
|
||||
if (! $result > 0)
|
||||
{
|
||||
dol_print_error($db,$ecmdir->error);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$form=new Form($db);
|
||||
$ecmdirstatic = new EcmDirectory($db);
|
||||
$userstatic = new User($db);
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// Upload file
|
||||
if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
// Define relativepath and upload_dir
|
||||
$relativepath='';
|
||||
if ($ecmdir->id) $relativepath=$ecmdir->getRelativePath();
|
||||
else $relativepath=$section_dir;
|
||||
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
|
||||
|
||||
if (empty($_FILES['userfile']['tmp_name']))
|
||||
{
|
||||
$error++;
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("File")), 'errors');
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0, 0, $_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
//$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
//print_r($_FILES);
|
||||
$result=$ecmdir->changeNbOfFiles('+');
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFileNotUploaded"), 'errors');
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFileIsInfectedWithAVirus"), 'errors');
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
setEventMessage($langs->trans($resupload), 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFailToCreateDir",$upload_dir).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Add directory
|
||||
if ($action == 'add' && $user->rights->ecm->setup)
|
||||
{
|
||||
$ecmdir->ref = 'NOTUSEDYET';
|
||||
$ecmdir->label = GETPOST("label");
|
||||
$ecmdir->description = GETPOST("desc");
|
||||
|
||||
$id = $ecmdir->create($user);
|
||||
if ($id > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">Error '.$langs->trans($ecmdir->error).'</div>';
|
||||
$action = "create";
|
||||
}
|
||||
|
||||
clearstatcache();
|
||||
}
|
||||
|
||||
// Remove file
|
||||
if ($action == 'confirm_deletefile')
|
||||
{
|
||||
if (GETPOST('confirm') == 'yes')
|
||||
{
|
||||
$langs->load("other");
|
||||
if ($section)
|
||||
{
|
||||
$result=$ecmdir->fetch($section);
|
||||
if (! ($result > 0))
|
||||
{
|
||||
dol_print_error($db,$ecmdir->error);
|
||||
exit;
|
||||
}
|
||||
$relativepath=$ecmdir->getRelativePath();
|
||||
}
|
||||
else $relativepath='';
|
||||
$upload_dir = $conf->ecm->dir_output.($relativepath?'/'.$relativepath:'');
|
||||
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_POST are already decoded by PHP).
|
||||
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
|
||||
$result=$ecmdir->changeNbOfFiles('-');
|
||||
|
||||
clearstatcache();
|
||||
}
|
||||
$action='file_manager';
|
||||
}
|
||||
|
||||
// Remove directory
|
||||
if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
|
||||
{
|
||||
$result=$ecmdir->delete($user);
|
||||
$mesg = '<div class="ok">'.$langs->trans("ECMSectionWasRemoved", $ecmdir->label).'</div>';
|
||||
|
||||
clearstatcache();
|
||||
}
|
||||
|
||||
// Refresh directory view
|
||||
if ($action == 'refreshmanual')
|
||||
{
|
||||
$ecmdirtmp = new EcmDirectory($db);
|
||||
|
||||
// This part of code is same than into file ecm/ajax/ecmdatabase.php TODO Remove duplicate
|
||||
clearstatcache();
|
||||
|
||||
$diroutputslash=str_replace('\\','/',$conf->ecm->dir_output);
|
||||
$diroutputslash.='/';
|
||||
|
||||
// Scan directory tree on disk
|
||||
$disktree=dol_dir_list($conf->ecm->dir_output,'directories',1,'','^temp$','','',0);
|
||||
|
||||
// Scan directory tree in database
|
||||
$sqltree=$ecmdirstatic->get_full_arbo(0);
|
||||
|
||||
$adirwascreated=0;
|
||||
|
||||
// Now we compare both trees to complete missing trees into database
|
||||
//var_dump($disktree);
|
||||
//var_dump($sqltree);
|
||||
foreach($disktree as $dirdesc) // Loop on tree onto disk
|
||||
{
|
||||
$dirisindatabase=0;
|
||||
foreach($sqltree as $dirsqldesc)
|
||||
{
|
||||
if ($conf->ecm->dir_output.'/'.$dirsqldesc['fullrelativename'] == $dirdesc['fullname'])
|
||||
{
|
||||
$dirisindatabase=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $dirisindatabase)
|
||||
{
|
||||
$txt="Directory found on disk ".$dirdesc['fullname'].", not found into database so we add it";
|
||||
dol_syslog($txt);
|
||||
//print $txt."<br>\n";
|
||||
|
||||
// We must first find the fk_parent of directory to create $dirdesc['fullname']
|
||||
$fk_parent=-1;
|
||||
$relativepathmissing=str_replace($diroutputslash,'',$dirdesc['fullname']);
|
||||
$relativepathtosearchparent=$relativepathmissing;
|
||||
//dol_syslog("Try to find parent id for directory ".$relativepathtosearchparent);
|
||||
if (preg_match('/\//',$relativepathtosearchparent))
|
||||
//while (preg_match('/\//',$relativepathtosearchparent))
|
||||
{
|
||||
$relativepathtosearchparent=preg_replace('/\/[^\/]*$/','',$relativepathtosearchparent);
|
||||
$txt="Is relative parent path ".$relativepathtosearchparent." for ".$relativepathmissing." found in sql tree ?";
|
||||
dol_syslog($txt);
|
||||
//print $txt." -> ";
|
||||
$parentdirisindatabase=0;
|
||||
foreach($sqltree as $dirsqldesc)
|
||||
{
|
||||
if ($dirsqldesc['fullrelativename'] == $relativepathtosearchparent)
|
||||
{
|
||||
$parentdirisindatabase=$dirsqldesc['id'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($parentdirisindatabase > 0)
|
||||
{
|
||||
dol_syslog("Yes with id ".$parentdirisindatabase);
|
||||
//print "Yes with id ".$parentdirisindatabase."<br>\n";
|
||||
$fk_parent=$parentdirisindatabase;
|
||||
//break; // We found parent, we can stop the while loop
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("No");
|
||||
//print "No<br>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("Parent is root");
|
||||
$fk_parent=0; // Parent is root
|
||||
}
|
||||
|
||||
if ($fk_parent >= 0)
|
||||
{
|
||||
$ecmdirtmp->ref = 'NOTUSEDYET';
|
||||
$ecmdirtmp->label = dol_basename($dirdesc['fullname']);
|
||||
$ecmdirtmp->description = '';
|
||||
$ecmdirtmp->fk_parent = $fk_parent;
|
||||
|
||||
$txt="We create directory ".$ecmdirtmp->label." with parent ".$fk_parent;
|
||||
dol_syslog($txt);
|
||||
//print $ecmdirtmp->cachenbofdoc."<br>\n";exit;
|
||||
$id = $ecmdirtmp->create($user);
|
||||
if ($id > 0)
|
||||
{
|
||||
$newdirsql=array('id'=>$id,
|
||||
'id_mere'=>$ecmdirtmp->fk_parent,
|
||||
'label'=>$ecmdirtmp->label,
|
||||
'description'=>$ecmdirtmp->description,
|
||||
'fullrelativename'=>$relativepathmissing);
|
||||
$sqltree[]=$newdirsql; // We complete fulltree for following loops
|
||||
//var_dump($sqltree);
|
||||
$adirwascreated=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("Failed to create directory ".$ecmdirtmp->label, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$txt="Parent of ".$dirdesc['fullname']." not found";
|
||||
dol_syslog($txt);
|
||||
//print $txt."<br>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Loop now on each sql tree to check if dir exists
|
||||
foreach($sqltree as $dirdesc) // Loop on each sqltree to check dir is on disk
|
||||
{
|
||||
$dirtotest=$conf->ecm->dir_output.'/'.$dirdesc['fullrelativename'];
|
||||
if (! dol_is_dir($dirtotest))
|
||||
{
|
||||
$mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."<br>\n";
|
||||
$ecmdirtmp->id=$dirdesc['id'];
|
||||
$ecmdirtmp->delete($user,'databaseonly');
|
||||
//exit;
|
||||
}
|
||||
}
|
||||
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown"
|
||||
dol_syslog("sql = ".$sql);
|
||||
$db->query($sql);
|
||||
|
||||
// If a directory was added, the fulltree array is not correctly completed and sorted, so we clean
|
||||
// it to be sure that fulltree array is not used without reloading it.
|
||||
if ($adirwascreated) $sqltree=null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
// Define height of file area (depends on $_SESSION["dol_screenheight"])
|
||||
//print $_SESSION["dol_screenheight"];
|
||||
$maxheightwin=(isset($_SESSION["dol_screenheight"]) && $_SESSION["dol_screenheight"] > 466)?($_SESSION["dol_screenheight"]-186):660; // Also into index.php file
|
||||
|
||||
$morejs=array();
|
||||
if (empty($conf->global->MAIN_ECM_DISABLE_JS)) $morejs=array("/includes/jquery/plugins/jqueryFileTree/jqueryFileTree.js");
|
||||
$moreheadcss="
|
||||
<!-- dol_screenheight=".$_SESSION["dol_screenheight"]." -->
|
||||
<style type=\"text/css\">
|
||||
#containerlayout {
|
||||
height: ".$maxheightwin."px;
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
min-width: 700px;
|
||||
_width: 700px; /* min-width for IE6 */
|
||||
}
|
||||
</style>";
|
||||
$moreheadjs=empty($conf->use_javascript_ajax)?"":"
|
||||
<script type=\"text/javascript\">
|
||||
jQuery(document).ready(function () {
|
||||
jQuery('#containerlayout').layout({
|
||||
name: \"ecmlayout\"
|
||||
, paneClass: \"ecm-layout-pane\"
|
||||
, resizerClass: \"ecm-layout-resizer\"
|
||||
, togglerClass: \"ecm-layout-toggler\"
|
||||
, center__paneSelector: \"#ecm-layout-center\"
|
||||
, north__paneSelector: \"#ecm-layout-north\"
|
||||
, west__paneSelector: \"#ecm-layout-west\"
|
||||
, resizable: true
|
||||
, north__size: 32
|
||||
, north__resizable: false
|
||||
, north__closable: false
|
||||
, west__size: 340
|
||||
, west__minSize: 280
|
||||
, west__slidable: true
|
||||
, west__resizable: true
|
||||
, west__togglerLength_closed: '100%'
|
||||
, useStateCookie: true
|
||||
});
|
||||
|
||||
jQuery('#ecm-layout-center').layout({
|
||||
center__paneSelector: \".ecm-in-layout-center\"
|
||||
, resizable: false
|
||||
});
|
||||
});
|
||||
</script>";
|
||||
|
||||
llxHeader($moreheadcss.$moreheadjs,$langs->trans("ECMArea"),'','','','',$morejs,'',0,0);
|
||||
|
||||
|
||||
// Add sections to manage
|
||||
$rowspan=0;
|
||||
$sectionauto=array();
|
||||
if (! empty($conf->global->ECM_AUTO_TREE_ENABLED))
|
||||
{
|
||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $langs->load("products"); $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>(! empty($conf->product->enabled) || ! empty($conf->service->enabled)), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); }
|
||||
if (! empty($conf->societe->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); }
|
||||
if (! empty($conf->propal->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); }
|
||||
if (! empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); }
|
||||
if (! empty($conf->commande->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled,'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); }
|
||||
if (! empty($conf->facture->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }
|
||||
if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); }
|
||||
if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }
|
||||
if (! empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBySocialContributions")); }
|
||||
if (! empty($conf->projet->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsByProjects")); }
|
||||
}
|
||||
|
||||
print_fiche_titre($langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager"));
|
||||
|
||||
$helptext1=''; $helptext2='';
|
||||
$helptext1.=$langs->trans("ECMAreaDesc");
|
||||
$helptext1.=$langs->trans("ECMAreaDesc2");
|
||||
$helptext2.=$langs->trans("ECMAreaDesc");
|
||||
$helptext2.=$langs->trans("ECMAreaDesc2");
|
||||
|
||||
/*
|
||||
print '<div class="hideonsmartphone">';
|
||||
print $langs->trans("ECMAreaDesc")."<br>";
|
||||
print $langs->trans("ECMAreaDesc2")."<br>";
|
||||
print "<br>\n";
|
||||
print '</div>';
|
||||
*/
|
||||
|
||||
// Confirm remove file (for non javascript users)
|
||||
if ($action == 'delete' && empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);
|
||||
|
||||
}
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
if (! empty($conf->use_javascript_ajax)) $classviewhide='hidden';
|
||||
else $classviewhide='visible';
|
||||
|
||||
|
||||
if (empty($conf->dol_use_jmobile))
|
||||
{
|
||||
$head = ecm_prepare_dasboard_head('');
|
||||
dol_fiche_head($head, 'index_auto', '', 1, '');
|
||||
}
|
||||
|
||||
// Start container of all panels
|
||||
?>
|
||||
<div id="containerlayout"> <!-- begin div id="containerlayout" -->
|
||||
<div id="ecm-layout-north" class="toolbar largebutton">
|
||||
<?php
|
||||
|
||||
// Start top panel, toolbar
|
||||
print '<div class="toolbarbutton">';
|
||||
|
||||
// Toolbar
|
||||
$url=((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module?'&module='.$module:'').($section?'&section='.$section:'')));
|
||||
print '<a href="'.$url.'" class="toolbarbutton" title="'.dol_escape_htmltag($langs->trans('Refresh')).'">';
|
||||
print '<img id="refreshbutton" class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/view-refresh.png">';
|
||||
print '</a>';
|
||||
|
||||
print '</div>';
|
||||
// End top panel, toolbar
|
||||
|
||||
?>
|
||||
</div>
|
||||
<div id="ecm-layout-west" class="<?php echo $classviewhide; ?>">
|
||||
<?php
|
||||
// Start left area
|
||||
|
||||
|
||||
// Confirmation de la suppression d'une ligne categorie
|
||||
if ($action == 'delete_section')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1);
|
||||
}
|
||||
// End confirm
|
||||
|
||||
|
||||
if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$action) || $action == 'delete')
|
||||
{
|
||||
print '<table width="100%" class="nobordernopadding">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre" align="left" colspan="6">';
|
||||
print ' '.$langs->trans("ECMSections");
|
||||
print '</td></tr>';
|
||||
|
||||
$showonrightsize='';
|
||||
// Auto section
|
||||
if (count($sectionauto))
|
||||
{
|
||||
$htmltooltip=$langs->trans("ECMAreaDesc2");
|
||||
|
||||
// Root title line (Automatic section)
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print '<table class="nobordernopadding"><tr class="nobordernopadding">';
|
||||
print '<td align="left" width="24">';
|
||||
print img_picto_common('','treemenu/base.gif');
|
||||
print '</td><td align="left">';
|
||||
$txt=$langs->trans("ECMRoot").' ('.$langs->trans("ECMSectionsAuto").')';
|
||||
print $form->textwithpicto($txt, $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
print '</tr></table>';
|
||||
print '</td>';
|
||||
print '<td align="right"> </td>';
|
||||
print '<td align="right"> </td>';
|
||||
print '<td align="right"> </td>';
|
||||
print '<td align="right"> </td>';
|
||||
print '<td align="center">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$sectionauto=dol_sort_array($sectionauto,'label','ASC',true,false);
|
||||
|
||||
print '<tr>';
|
||||
print '<td colspan="6" style="padding-left: 20px">';
|
||||
print '<div id="filetreeauto" class="ecmfiletree"><ul class="ecmjqft">';
|
||||
|
||||
$nbofentries=0;
|
||||
$oldvallevel=0;
|
||||
foreach ($sectionauto as $key => $val)
|
||||
{
|
||||
if (empty($val['test'])) continue; // If condition to show is ok
|
||||
|
||||
$var=false;
|
||||
|
||||
print '<li class="directory collapsed">';
|
||||
if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))
|
||||
{
|
||||
print '<a class="fmdirlia jqft ecmjqft" href="'.$_SERVER["PHP_SELF"].'?module='.$val['module'].'">';
|
||||
print $val['label'];
|
||||
print '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="fmdirlia jqft ecmjqft" href="'.$_SERVER["PHP_SELF"].'?module='.$val['module'].'">';
|
||||
print $val['label'];
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
print '<div class="ecmjqft">';
|
||||
// Info
|
||||
$htmltooltip='<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
|
||||
$htmltooltip='<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionAuto").'<br>';
|
||||
$htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$langs->trans("ECMTypeAuto").'<br>';
|
||||
$htmltooltip.='<b>'.$langs->trans("Description").'</b>: '.$val['desc'];
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 'info');
|
||||
print '</div>';
|
||||
print '</li>';
|
||||
|
||||
$nbofentries++;
|
||||
}
|
||||
|
||||
print '</ul></div></td></tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
|
||||
// End left banner
|
||||
?>
|
||||
</div>
|
||||
<div id="ecm-layout-center" class="<?php echo $classviewhide; ?>">
|
||||
<div class="pane-in ecm-in-layout-center">
|
||||
<div id="ecmfileview" class="ecmfileview">
|
||||
<?php
|
||||
// Start right panel
|
||||
|
||||
|
||||
$mode='noajax';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php';
|
||||
|
||||
|
||||
// End right panel
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div> <!-- end div id="containerlayout" -->
|
||||
<?php
|
||||
// End of page
|
||||
|
||||
|
||||
//dol_fiche_end();
|
||||
|
||||
|
||||
if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) {
|
||||
include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php';
|
||||
}
|
||||
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
@ -13,12 +13,12 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
* Output javascript for interactions code of ecm module
|
||||
*/
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE ecm/tpl/builddatabase.tpl.php -->
|
||||
<!-- BEGIN PHP TEMPLATE ecm/tpl/enablefiletreeajax.tpl.php -->
|
||||
<!-- Doc of fileTree plugin at http://www.abeautifulsite.net/blog/2008/03/jquery-file-tree/ -->
|
||||
|
||||
<script type="text/javascript">
|
||||
@ -29,7 +29,7 @@ $openeddir='/';
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#filetree').fileTree({
|
||||
$('#filetree').fileTree({
|
||||
root: '<?php print dol_escape_js($openeddir); ?>',
|
||||
// Ajax called if we click to expand a dir (not a file). Parameter of dir is provided as a POST parameter.
|
||||
script: '<?php echo DOL_URL_ROOT.'/core/ajax/ajaxdirtree.php?modulepart=ecm&openeddir='.urlencode($openeddir); ?>',
|
||||
@ -882,9 +882,10 @@ class Expedition extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete shipment
|
||||
* Delete shipment.
|
||||
* Warning, do not delete a shipment if a delivery is linked to (with table llx_element_element)
|
||||
*
|
||||
* @return int >0 if OK otherwise if KO
|
||||
* @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO
|
||||
*/
|
||||
function delete()
|
||||
{
|
||||
@ -893,6 +894,14 @@ class Expedition extends CommonObject
|
||||
|
||||
$error=0;
|
||||
|
||||
// Add a protection to refuse deleting if shipment has at least one delivery
|
||||
$this->fetchObjectLinked($this->id, 'shipping', 0, 'delivery'); // Get deliveries linked to this shipment
|
||||
if (count($this->linkedObjectsIds) > 0)
|
||||
{
|
||||
$this->error='ErrorThereIsSomeDeliveries';
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if ($conf->productbatch->enabled) {
|
||||
@ -942,7 +951,7 @@ class Expedition extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if(! $error)
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."expeditiondet";
|
||||
$sql.= " WHERE fk_expedition = ".$this->id;
|
||||
@ -960,31 +969,6 @@ class Expedition extends CommonObject
|
||||
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
$this->db->commit();
|
||||
|
||||
// On efface le repertoire de pdf provisoire
|
||||
$ref = dol_sanitizeFileName($this->ref);
|
||||
if (! empty($conf->expedition->dir_output))
|
||||
{
|
||||
$dir = $conf->expedition->dir_output . '/sending/' . $ref ;
|
||||
$file = $dir . '/' . $ref . '.pdf';
|
||||
if (file_exists($file))
|
||||
{
|
||||
if (! dol_delete_file($file))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (file_exists($dir))
|
||||
{
|
||||
if (!dol_delete_dir($dir))
|
||||
{
|
||||
$this->error=$langs->trans("ErrorCanNotDeleteDir",$dir);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Call triggers
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
@ -992,7 +976,40 @@ class Expedition extends CommonObject
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// End call triggers
|
||||
|
||||
return 1;
|
||||
if (! $error)
|
||||
{
|
||||
$this->db->commit();
|
||||
|
||||
// We delete PDFs
|
||||
$ref = dol_sanitizeFileName($this->ref);
|
||||
if (! empty($conf->expedition->dir_output))
|
||||
{
|
||||
$dir = $conf->expedition->dir_output . '/sending/' . $ref ;
|
||||
$file = $dir . '/' . $ref . '.pdf';
|
||||
if (file_exists($file))
|
||||
{
|
||||
if (! dol_delete_file($file))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (file_exists($dir))
|
||||
{
|
||||
if (!dol_delete_dir($dir))
|
||||
{
|
||||
$this->error=$langs->trans("ErrorCanNotDeleteDir",$dir);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -221,7 +221,7 @@ if ($action == 'add')
|
||||
|
||||
/*
|
||||
* Build a receiving receipt
|
||||
*/
|
||||
*/
|
||||
else if ($action == 'create_delivery' && $conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)
|
||||
{
|
||||
$result = $object->create_delivery($user);
|
||||
@ -273,8 +273,9 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expe
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = $object->error;
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans($object->error),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -824,7 +824,7 @@ if ($step == 4 && $datatoimport)
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
print "<!-- End box container -->\n";
|
||||
print "<!-- End box left container -->\n";
|
||||
|
||||
|
||||
print '</td><td width="50%">';
|
||||
|
||||
@ -30,6 +30,9 @@ create table llx_c_email_templates
|
||||
)ENGINE=innodb;
|
||||
|
||||
|
||||
ALTER TABLE llx_bank_account MODIFY COLUMN account_number varchar(24);
|
||||
|
||||
|
||||
-- delete foreign key that should never exists
|
||||
ALTER TABLE llx_propal DROP FOREIGN KEY fk_propal_fk_currency;
|
||||
ALTER TABLE llx_commande DROP FOREIGN KEY fk_commande_fk_currency;
|
||||
@ -1133,3 +1136,16 @@ insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang)
|
||||
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (35,'TASK_CREATE','Task created','Executed when a project task is created','project',35);
|
||||
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (36,'TASK_MODIFY','Task modified','Executed when a project task is modified','project',36);
|
||||
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (37,'TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37);
|
||||
|
||||
-- New : category translation
|
||||
create table llx_categorie_lang
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
fk_category integer DEFAULT 0 NOT NULL,
|
||||
lang varchar(5) DEFAULT 0 NOT NULL,
|
||||
label varchar(255) NOT NULL,
|
||||
description text
|
||||
)ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_categorie_lang ADD UNIQUE INDEX uk_category_lang (fk_category, lang);
|
||||
ALTER TABLE llx_categorie_lang ADD CONSTRAINT fk_category_lang_fk_category FOREIGN KEY (fk_category) REFERENCES llx_categorie (rowid);
|
||||
|
||||
@ -112,6 +112,7 @@ UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps
|
||||
-- ALTER TABLE llx_product_fournisseur_price DROP COLUMN fk_product_fournisseur;
|
||||
ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseur;
|
||||
|
||||
|
||||
-- Fix: deprecated tag to new one
|
||||
update llx_opensurvey_sondage set format = 'D' where format = 'D+';
|
||||
update llx_opensurvey_sondage set format = 'A' where format = 'A+';
|
||||
@ -142,3 +143,4 @@ update llx_societe set barcode = null where (rowid, barcode) in (select max_rowi
|
||||
drop table tmp_societe_double;
|
||||
|
||||
|
||||
UPDATE llx_projet_task SET fk_task_parent = 0 WHERE fk_task_parent = rowid
|
||||
|
||||
@ -47,7 +47,7 @@ create table llx_bank_account
|
||||
clos smallint DEFAULT 0 NOT NULL,
|
||||
rappro smallint DEFAULT 1,
|
||||
url varchar(128),
|
||||
account_number varchar(8),
|
||||
account_number varchar(24), -- bank accountancy number
|
||||
currency_code varchar(3) NOT NULL,
|
||||
min_allowed integer DEFAULT 0,
|
||||
min_desired integer DEFAULT 0,
|
||||
|
||||
20
htdocs/install/mysql/tables/llx_categorie_lang.key.sql
Normal file
@ -0,0 +1,20 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2014 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ============================================================================
|
||||
|
||||
ALTER TABLE llx_categorie_lang ADD UNIQUE INDEX uk_category_lang (fk_category, lang);
|
||||
ALTER TABLE llx_categorie_lang ADD CONSTRAINT fk_category_lang_fk_category FOREIGN KEY (fk_category) REFERENCES llx_categorie (rowid);
|
||||
29
htdocs/install/mysql/tables/llx_categorie_lang.sql
Normal file
@ -0,0 +1,29 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
-- Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
-- Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2014 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ============================================================================
|
||||
|
||||
create table llx_categorie_lang
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
fk_category integer DEFAULT 0 NOT NULL,
|
||||
lang varchar(5) DEFAULT 0 NOT NULL,
|
||||
label varchar(255) NOT NULL,
|
||||
description text
|
||||
)ENGINE=innodb;
|
||||
@ -313,7 +313,6 @@ EditDeliveryAddress=Modificar adreça d'enviament
|
||||
ThisUserIsNot=Aquest usuari no és ni un client potencial, ni un client, ni un proveïdor
|
||||
VATIntraCheck=Verificar
|
||||
VATIntraCheckDesc=El link <b>%s</b> permet consultar al servei europeu de control de números d'IVA intracomunitari. Es requereix accés a internet per a que el servei funcioni
|
||||
VATIntraCheckURL=http://ec.europa.eu/taxation_customs/vies/lang.do?fromWhichPage=vieshome&selectedLanguage=ES
|
||||
VATIntraCheckableOnEUSite=Verificar a la web de la Comissió Europea
|
||||
VATIntraManualCheck=Podeu també fer una verificació manual a la web europea <a href="%s" target="_blank">%s</a>
|
||||
ErrorVATCheckMS_UNAVAILABLE=Comprovació impossible. El servei de comprovació no és prestat pel país membre (%s).
|
||||
|
||||
@ -367,7 +367,7 @@ ExtrafieldRadio=Radio button
|
||||
ExtrafieldParamHelpselect=Parameters list have to be like key,value<br><br> for exemple : <br>1,value1<br>2,value2<br>3,value3<br>...<br><br>In order to have the list depending on another :<br>1,value1|parent_list_code:parent_key<br>2,value2|parent_list_code:parent_key
|
||||
ExtrafieldParamHelpcheckbox=Parameters list have to be like key,value<br><br> for exemple : <br>1,value1<br>2,value2<br>3,value3<br>...
|
||||
ExtrafieldParamHelpradio=Parameters list have to be like key,value<br><br> for exemple : <br>1,value1<br>2,value2<br>3,value3<br>...
|
||||
ExtrafieldParamHelpsellist=Parameters list have come from table<br><br> for exemple : <br>c_typent:libelle:id::filter<br><br>In order to have the list depending on another :<br>c_typent:libelle:id:parent_list_code|parent_column:filter <br> filter can be a simple test (eg active=1) to display only active value <br> if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)
|
||||
ExtrafieldParamHelpsellist=Parameters list comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value <br> if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another :<br>c_typent:libelle:id:parent_list_code|parent_column:filter
|
||||
LibraryToBuildPDF=Library used to build PDF
|
||||
WarningUsingFPDF=Warning: Your <b>conf.php</b> contains directive <b>dolibarr_pdf_force_fpdf=1</b>. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation.<br>To solve this and have a full support of PDF generation, please download <a href="http://www.tcpdf.org/" target="_blank">TCPDF library</a>, then comment or remove the line <b>$dolibarr_pdf_force_fpdf=1</b>, and add instead <b>$dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'</b>
|
||||
LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:<br>1 : local tax apply on products and services without vat (vat is not applied on local tax)<br>2 : local tax apply on products and services before vat (vat is calculated on amount + localtax)<br>3 : local tax apply on products without vat (vat is not applied on local tax)<br>4 : local tax apply on products before vat (vat is calculated on amount + localtax)<br>5 : local tax apply on services without vat (vat is not applied on local tax)<br>6 : local tax apply on services before vat (vat is calculated on amount + localtax)
|
||||
|
||||
@ -135,6 +135,8 @@ ErrorWarehouseMustDiffers=Source and target warehouses must differs
|
||||
ErrorBadFormat=Bad format!
|
||||
ErrorPaymentDateLowerThanInvoiceDate=Payment date (%s) cant' be before invoice date (%s) for invoice %s.
|
||||
ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst=Error, this member is not yet linked to any thirdparty. Link member to an existing third party or create a new thirdparty before creating subscription with invoice.
|
||||
ErrorThereIsSomeDeliveries=Error, there is some deliveries linked to this shipment. Deletion refused.
|
||||
|
||||
# Warnings
|
||||
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined
|
||||
WarningSafeModeOnCheckExecDir=Warning, PHP option <b>safe_mode</b> is on so command must be stored inside a directory declared by php parameter <b>safe_mode_exec_dir</b>.
|
||||
|
||||
@ -117,3 +117,8 @@ SelectProductInAndOutWareHouse=Select a product, a quantity, a source warehouse
|
||||
RecordMovement=Record transfert
|
||||
ReceivingForSameOrder=Receivings for this order
|
||||
StockMovementRecorded=Stock movements recorded
|
||||
RuleForStockAvailability=Rules on stock requirements
|
||||
StockMustBeEnoughForInvoice=Stock level must be enough to add product/service into invoice
|
||||
StockMustBeEnoughForOrder=Stock level must be enough to add product/service into order
|
||||
StockMustBeEnoughForShipment= Stock level must be enough to add product/service into shipment
|
||||
|
||||
|
||||
@ -313,7 +313,6 @@ EditDeliveryAddress=Modificar dirección de envío
|
||||
ThisUserIsNot=Este usuario no es ni un cliente potencial, ni un cliente, ni un proveedor
|
||||
VATIntraCheck=Verificar
|
||||
VATIntraCheckDesc=El link <b>%s</b> permite consultar al servicio europeo de control de números de IVA intracomunitario. Se requiere acceso a internet para que el servicio funcione
|
||||
VATIntraCheckURL=http://ec.europa.eu/taxation_customs/vies/lang.do?fromWhichPage=vieshome&selectedLanguage=ES
|
||||
VATIntraCheckableOnEUSite=Verificar en la web de la Comisión Europea
|
||||
VATIntraManualCheck=Puede también realizar una verificación manual en la web europea <a href="%s" target="_blank">%s</a>
|
||||
ErrorVATCheckMS_UNAVAILABLE=Comprobación imposible. El servicio de comprobación no es prestado por el país país miembro (%s).
|
||||
|
||||
@ -18,10 +18,10 @@ ErrorFailToCreateFile=Echec de la création du fichier '<b>%s</b>'.
|
||||
ErrorFailToRenameDir=Echec du renommage du répertoire '<b>%s</b>' en '<b>%s</b>'.
|
||||
ErrorFailToCreateDir=Echec de création du répertoire '<b>%s</b>'.
|
||||
ErrorFailToDeleteDir=Echec de la suppression du répertoire '<b>%s</b>'.
|
||||
ErrorFailedToDeleteJoinedFiles=Impossible de supprimer l'entité car il existe des pièces jointes. Supprimer d'abord les pièces jointes.
|
||||
ErrorFailedToDeleteJoinedFiles=Impossible de supprimer l'entité car il existe des pièces jointes. Supprimez d'abord les pièces jointes.
|
||||
ErrorThisContactIsAlreadyDefinedAsThisType=Ce contact est déjà défini comme contact pour ce type.
|
||||
ErrorCashAccountAcceptsOnlyCashMoney=Ce compte bancaire est de type caisse et n'accepte que les mode de règlement de type <b>espèce</b>.
|
||||
ErrorFromToAccountsMustDiffers=Le compte source et destination doivent être différents.
|
||||
ErrorCashAccountAcceptsOnlyCashMoney=Ce compte bancaire est de type caisse et n'accepte que le mode de règlement de type <b>espèce</b>.
|
||||
ErrorFromToAccountsMustDiffers=Les comptes source et destination doivent être différents.
|
||||
ErrorBadThirdPartyName=Nom de tiers incorrect
|
||||
ErrorProdIdIsMandatory=Le %s est obligatoire
|
||||
ErrorBadCustomerCodeSyntax=La syntaxe du code client est incorrecte
|
||||
@ -44,9 +44,9 @@ ErrorFailedToWriteInDir=Impossible d'écrire dans le répertoire %s
|
||||
ErrorFoundBadEmailInFile=Syntaxe de mail incorrecte trouvée pour %s lignes dans le fichier (exemple ligne %s avec email=%s)
|
||||
ErrorUserCannotBeDelete=L'utilisateur ne peut pas être supprimé. Peut-être est-il associé à des éléments de Dolibarr.
|
||||
ErrorFieldsRequired=Des champs obligatoires n'ont pas été renseignés
|
||||
ErrorFailedToCreateDir=Echec à la création d'un répertoire. Vérifiez que le user du serveur Web a bien les droits d'écriture dans les répertoires documents de Dolibarr. Si le paramètre <b>safe_mode</b> a été activé sur ce PHP, vérifier que les fichiers php dolibarr appartiennent à l'utilisateur du serveur Web.
|
||||
ErrorFailedToCreateDir=Echec à la création d'un répertoire. Vérifiez que le user du serveur Web a bien les droits d'écriture dans les répertoires documents de Dolibarr. Si le paramètre <b>safe_mode</b> a été activé sur ce PHP, vérifiez que les fichiers php dolibarr appartiennent à l'utilisateur du serveur Web.
|
||||
ErrorNoMailDefinedForThisUser=EMail non défini pour cet utilisateur
|
||||
ErrorFeatureNeedJavascript=Cette fonctionnalité a besoin de javascript activé pour fonctionner. Modifier dans configuration - affichage.
|
||||
ErrorFeatureNeedJavascript=Cette fonctionnalité a besoin de javascript activé pour fonctionner. Modifiez dans configuration - affichage.
|
||||
ErrorTopMenuMustHaveAParentWithId0=Un menu de type 'Top' ne peut avoir de menu père. Mettre 0 dans l'id père ou choisir un menu de type 'Left'.
|
||||
ErrorLeftMenuMustHaveAParentId=Un menu de type 'Left' doit avoir un id de père.
|
||||
ErrorFileNotFound=Fichier <b>%s</b> introuvable (Mauvais chemin, permissions incorrectes ou accès interdit par le paramètre PHP openbasedir ou safe_mode)
|
||||
@ -60,8 +60,8 @@ ErrorUploadBlockedByAddon=Upload bloqué par un plugin PHP/Apache.
|
||||
ErrorFileSizeTooLarge=La taille du fichier est trop grande.
|
||||
ErrorSizeTooLongForIntType=Longueur de champ trop longue pour le type int (%s chiffres maximum)
|
||||
ErrorSizeTooLongForVarcharType=Longueur de champ trop longue pour le type chaine (%s caractères maximum)
|
||||
ErrorNoValueForSelectType=Les valeurs de la liste de selection doivent être renseignées
|
||||
ErrorNoValueForCheckBoxType=Les valeurs de la liste de case a cochées doivent être renseignées
|
||||
ErrorNoValueForSelectType=Les valeurs de la liste de sélection doivent être renseignées
|
||||
ErrorNoValueForCheckBoxType=Les valeurs de la liste de cases à cocher doivent être renseignées
|
||||
ErrorNoValueForRadioType=Les valeurs de la liste d'options doivent être renseignées
|
||||
ErrorBadFormatValueList=Les valeurs de la liste ne peuvent pas contenir plus d'une virgule : <b>%s</b>, mais doivent en avoir au moins une: clef,valeur
|
||||
ErrorFieldCanNotContainSpecialCharacters=Le champ <b>%s</b> ne peut contenir de caractères spéciaux.
|
||||
@ -69,7 +69,7 @@ ErrorFieldCanNotContainSpecialNorUpperCharacters=Le champ <b>%s</b> ne doit pas
|
||||
ErrorNoAccountancyModuleLoaded=Aucun module de comptabilité activé
|
||||
ErrorExportDuplicateProfil=Ce nom de profil existe déjà pour ce lot d'export.
|
||||
ErrorLDAPSetupNotComplete=Le matching Dolibarr-LDAP est incomplet.
|
||||
ErrorLDAPMakeManualTest=Un fichier .ldif a été généré dans le répertoire %s. Essayez de charger ce fichier en manuel depuis la ligne de commande pour plus de détail sur l'erreur.
|
||||
ErrorLDAPMakeManualTest=Un fichier .ldif a été généré dans le répertoire %s. Essayez de charger ce fichier manuellement depuis la ligne de commande pour plus de détail sur l'erreur.
|
||||
ErrorCantSaveADoneUserWithZeroPercentage=Impossible de sauver une action à l'état non commencé avec un utilisateur défini comme ayant fait l'action.
|
||||
ErrorRefAlreadyExists=La référence utilisée pour la création existe déjà
|
||||
ErrorPleaseTypeBankTransactionReportName=Veuillez saisir le nom de relevé bancaire sur lequel l'écriture est constatée (Format AAAAMM de préférence ou AAAAMMJJ)
|
||||
@ -84,7 +84,7 @@ ErrorFieldRefNotIn=Mauvaise valeur pour le champ numéro <b>%s</b> (la valeur '<
|
||||
ErrorsOnXLines=Erreurs sur <b>%s</b> enregistrement(s) source
|
||||
ErrorFileIsInfectedWithAVirus=L'antivirus n'a pas pu valider ce fichier (il est probablement infecté par un virus) !
|
||||
ErrorSpecialCharNotAllowedForField=Les caractères spéciaux ne sont pas admis pour le champ "%s"
|
||||
ErrorDatabaseParameterWrong=Le paramètre de configuration de la base de donnée '<b>%s</b>' a une valeur non compatible pour une utilisation de Dolibarr (doit avoir la valeur '<b>%s</b>').
|
||||
ErrorDatabaseParameterWrong=Le paramètre de configuration de la base de données '<b>%s</b>' a une valeur non compatible pour une utilisation de Dolibarr (doit avoir la valeur '<b>%s</b>').
|
||||
ErrorNumRefModel=Une référence existe en base (%s) et est incompatible avec cette numérotation. Supprimez la ligne ou renommez la référence pour activer ce module.
|
||||
ErrorQtyTooLowForThisSupplier=Quantité insuffisante pour ce fournisseur ou aucun tarif défini sur ce produit pour ce fournisseur
|
||||
ErrorModuleSetupNotComplete=La configuration du module semble incomplète. Aller dans l'espace Configuration - Modules pour corriger.
|
||||
@ -96,7 +96,7 @@ ErrorProductWithRefNotExist=La référence produit '<i>%s</i>' n'existe pas
|
||||
ErrorDeleteNotPossibleLineIsConsolidated=Suppression impossible car l'enregistrement porte sur au moins une transaction bancaire rapprochée
|
||||
ErrorProdIdAlreadyExist=%s est attribué à un autre tiers
|
||||
ErrorFailedToSendPassword=Échec de l'envoi du mot de passe
|
||||
ErrorFailedToLoadRSSFile=Echec de la récupération du flux RSS. Ajouter la constante MAIN_SIMPLEXMLLOAD_DEBUG si le message d'erreur n'est pas assez explicite.
|
||||
ErrorFailedToLoadRSSFile=Echec de la récupération du flux RSS. Ajoutez la constante MAIN_SIMPLEXMLLOAD_DEBUG si le message d'erreur n'est pas assez explicite.
|
||||
ErrorPasswordDiffers=Les mots de passe ne sont pas identiques, veuillez les saisir à nouveau
|
||||
ErrorForbidden=Accès non autorisé.<br>Vous essayez d'accéder à une page, zone ou fonction sans être au sein d'une session authentifiée ou qui n'est pas autorisée pour votre compte utilisateur.
|
||||
ErrorForbidden2=Les permissions pour ce login peuvent être attribuées par l'administrateur Dolibarr via le menu %s -> %s.
|
||||
@ -106,16 +106,16 @@ ErrorRecordAlreadyExists=Enregistrement déjà existant
|
||||
ErrorCantReadFile=Échec de lecture du fichier '%s'
|
||||
ErrorCantReadDir=Échec de lecture du répertoire '%s'
|
||||
ErrorFailedToFindEntity=Échec de lecture de l'environnement '%s'
|
||||
ErrorBadLoginPassword=Identifiants login ou mot de passe incorrects
|
||||
ErrorBadLoginPassword=Identifiants login ou mot de passe incorrect
|
||||
ErrorLoginDisabled=Votre compte est désactivé
|
||||
ErrorFailedToRunExternalCommand=Échec de l'exécution de la commande externe. Vérifiez qu'elle est disponible et exécutable par votre serveur PHP. Si le <b>Safe Mode</b> PHP est actif, vérifiez que la commande se trouve dans un répertoire définie dans le paramètre <b>safe_mode_exec_dir</b>.
|
||||
ErrorFailedToRunExternalCommand=Échec de l'exécution de la commande externe. Vérifiez qu'elle est disponible et exécutable par votre serveur PHP. Si le <b>Safe Mode</b> PHP est actif, vérifiez que la commande se trouve dans un répertoire défini dans le paramètre <b>safe_mode_exec_dir</b>.
|
||||
ErrorFailedToChangePassword=Échec de modification du mot de passe
|
||||
ErrorLoginDoesNotExists=Le compte utilisateur de login <b>%s</b> n'a pu être trouvé.
|
||||
ErrorLoginHasNoEmail=Cet utilisateur n'a pas d'email. Impossible de continuer.
|
||||
ErrorBadValueForCode=Mauvaise valeur saisie pour le code. Réessayez avec une nouvelle valeur...
|
||||
ErrorBothFieldCantBeNegative=Les champs %s et %s ne peuvent être tous deux négatifs
|
||||
ErrorWebServerUserHasNotPermission=Le compte d'execution du serveur web <b>%s</b> n'a pas les permissions pour cela
|
||||
ErrorNoActivatedBarcode=Aucun type de code bar activé
|
||||
ErrorWebServerUserHasNotPermission=Le compte d'exécution du serveur web <b>%s</b> n'a pas les permissions pour cela
|
||||
ErrorNoActivatedBarcode=Aucun type de code-barres activé
|
||||
ErrUnzipFails=Impossible de décompresser le fichier %s avec ZipArchive
|
||||
ErrNoZipEngine=Pas de moteur pour décompresser le fichier %s dans ce PHP
|
||||
ErrorFileMustBeADolibarrPackage=Le fichier doit être un package Dolibarr
|
||||
@ -124,11 +124,11 @@ ErrorPhpCurlNotInstalled=L'extension PHP CURL n'est pas installée, ceci est ind
|
||||
ErrorFailedToAddToMailmanList=Echec de l'ajout de %s à la liste Mailman %s ou base SPIP
|
||||
ErrorFailedToRemoveToMailmanList=Echec de la suppression de %s de la liste Mailman %s ou base SPIP
|
||||
ErrorNewValueCantMatchOldValue=La nouvelle valeur ne peut être égale à l'ancienne
|
||||
ErrorFailedToValidatePasswordReset=Echec de la réinitialisation du mot de passe. Il est possible que ce lien ait déjà été utilisé (l'utilisation de ce lien ne fonctionne qu'une fois). Si ce n'est pas le cas, essayer de recommencer le processus de réinit de mot de passe depuis le début.
|
||||
ErrorToConnectToMysqlCheckInstance=Echec de la connection au serveur de base de donnée. Vérifier que Mysql est bien lancé (dans la plupart des cas, vous pouvez le lancer depuis la ligne de commande par la commande 'sudo /etc/init.d/mysql start').
|
||||
ErrorFailedToValidatePasswordReset=Echec de la réinitialisation du mot de passe. Il est possible que ce lien ait déjà été utilisé (l'utilisation de ce lien ne fonctionne qu'une fois). Si ce n'est pas le cas, essayer de recommencer le processus de réinitialisation de mot de passe depuis le début.
|
||||
ErrorToConnectToMysqlCheckInstance=Echec de la connection au serveur de base de données. Vérifiez que Mysql est bien lancé (dans la plupart des cas, vous pouvez le lancer depuis la ligne de commande par la commande 'sudo /etc/init.d/mysql start').
|
||||
ErrorFailedToAddContact=Echec à l'ajout du contact
|
||||
ErrorDateMustBeBeforeToday=La date ne peut pas être supérieure à aujourd'hui
|
||||
ErrorPaymentModeDefinedToWithoutSetup=Un mode de paiement a été défini de type %s mais la configuration du module Facture n'a pas été complété pour définir les informations afficher pour ce mode de paiment.
|
||||
ErrorPaymentModeDefinedToWithoutSetup=Un mode de paiement a été défini de type %s mais la configuration du module Facture n'a pas été complétée pour définir les informations affichées pour ce mode de paiment.
|
||||
ErrorPHPNeedModule=Erreur, votre PHP doit avoir le module <b>%s</b> installé pour utiliser cette fonctionnalité.
|
||||
ErrorOpenIDSetupNotComplete=Vous avez configuré Dolibarr pour accepter l'authentication OpenID, mais l'URL du service OpenID n'est pas défini dans la constante %s
|
||||
ErrorWarehouseMustDiffers=Les entrepôts source et destination doivent être différents
|
||||
|
||||
@ -313,7 +313,6 @@ EditDeliveryAddress=Modificar Direcção de Envío
|
||||
ThisUserIsNot=Este utilizador nem é um cliente potencial, nem um cliente, nem um fornecedor
|
||||
VATIntraCheck=Verificar
|
||||
VATIntraCheckDesc=o link <b>%s</b> permite consultar à serviço europeu de control de números de IVA intracomunitario. Requer acesso á internet para que o serviço funcione
|
||||
VATIntraCheckURL=http://ec.europa.eu/taxation_customs/vies/lang.do?fromWhichPage=vieshome&selectedLanguage=é
|
||||
VATIntraCheckableOnEUSite=Verificar na web da Comissão Europeia
|
||||
VATIntraManualCheck=Pode também realizar uma verificação manual na web europea <a href="%s" target="_blank">%s</a>
|
||||
ErrorVATCheckMS_UNAVAILABLE=Verificação Impossivel. O serviço de verificação não é prestado pelo país membro (%s).
|
||||
|
||||
@ -466,7 +466,8 @@ if (! defined('NOLOGIN'))
|
||||
|
||||
// Bad password. No authmode has found a good password.
|
||||
$user->trigger_mesg=$langs->trans("ErrorBadLoginPassword").' - login='.GETPOST("username","alpha",2);
|
||||
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword");
|
||||
// We set a generic message if not defined inside function checkLoginPassEntity or subfunctions
|
||||
if (empty($_SESSION["dol_loginmesg"])) $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword");
|
||||
|
||||
// Call of triggers
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||
@ -480,7 +481,7 @@ if (! defined('NOLOGIN'))
|
||||
}
|
||||
|
||||
// End test login / passwords
|
||||
if (! $login)
|
||||
if (! $login || (in_array('ldap',$authmode) && empty($passwordtotest))) // With LDAP we refused empty password because some LDAP are "opened" for anonymous access so connexion is a success.
|
||||
{
|
||||
// We show login page
|
||||
dol_loginfunction($langs,$conf,(! empty($mysoc)?$mysoc:''));
|
||||
@ -1492,7 +1493,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
||||
print '<div style="clear: both;"></div>';
|
||||
print "<!-- End top horizontal menu -->\n\n";
|
||||
|
||||
if (empty($conf->dol_hide_leftmenu) && (empty($conf->use_javascript_ajax) || ! empty($conf->dol_use_jmobile) || empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))) print '<div id="id-container">';
|
||||
if (empty($conf->dol_hide_leftmenu) && empty($conf->dol_use_jmobile) && empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '<div id="id-container">';
|
||||
}
|
||||
|
||||
|
||||
@ -1523,7 +1524,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
||||
$hookmanager->initHooks(array('searchform','leftblock'));
|
||||
|
||||
if (empty($conf->dol_use_jmobile) && ! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print "\n".'<div class="ui-layout-west"> <!-- Begin left layout -->'."\n";
|
||||
else print '<div id="id-left">';
|
||||
else print '<div id="id-left"> <!-- Begin id-left -->';
|
||||
|
||||
print "\n";
|
||||
|
||||
@ -1701,7 +1702,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
||||
print $leftblock;
|
||||
|
||||
if (empty($conf->dol_use_jmobile) && ! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '</div> <!-- End left layout -->'."\n";
|
||||
else print '</div>'; // End div id="id-left"
|
||||
else print '</div> <!-- end id-left -->'; // End div id="id-left"
|
||||
}
|
||||
|
||||
print "\n";
|
||||
@ -1722,10 +1723,7 @@ function main_area($title='')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
if (empty($conf->dol_use_jmobile) && ! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))
|
||||
{
|
||||
print '<div id="mainContent"><div class="ui-layout-center"> <!-- begin main layout -->'."\n";
|
||||
}
|
||||
if (empty($conf->dol_use_jmobile) && ! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '<div id="mainContent"><div class="ui-layout-center"> <!-- begin main layout -->'."\n";
|
||||
if (empty($conf->dol_hide_leftmenu)) print '<div id="id-right">';
|
||||
|
||||
print "\n";
|
||||
@ -1850,18 +1848,18 @@ if (! function_exists("llxFooter"))
|
||||
}
|
||||
|
||||
print "\n\n";
|
||||
print '</div> <!-- end div class="fiche" -->'."\n";
|
||||
print '</div> <!-- End div class="fiche" -->'."\n";
|
||||
if (! empty($conf->dol_use_jmobile)) print '</div>'; // end data-role="page"
|
||||
|
||||
if (empty($conf->dol_use_jmobile) && ! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '</div></div> <!-- end main layout -->'."\n";
|
||||
if (empty($conf->dol_hide_leftmenu)) print '</div>'; // End div id-right
|
||||
if (empty($conf->dol_hide_leftmenu)) print '</div> <!-- End div id-right -->'; // End div id-right
|
||||
|
||||
print "\n";
|
||||
if ($comment) print '<!-- '.$comment.' -->'."\n";
|
||||
|
||||
printCommonFooter($zone);
|
||||
|
||||
if (empty($conf->dol_hide_leftmenu)) print '</div>'; // End div container
|
||||
if (empty($conf->dol_hide_leftmenu) && empty($conf->dol_use_jmobile) && empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '</div> <!-- End div id-container -->'."\n"; // End div container
|
||||
|
||||
print "</body>\n";
|
||||
print "</html>\n";
|
||||
|
||||
@ -206,7 +206,7 @@ if (empty($reshook))
|
||||
|
||||
$object->barcode_type = GETPOST('fk_barcode_type');
|
||||
$object->barcode = GETPOST('barcode');
|
||||
|
||||
|
||||
$object->description = dol_htmlcleanlastbr(GETPOST('desc'));
|
||||
$object->url = GETPOST('url');
|
||||
$object->note = dol_htmlcleanlastbr(GETPOST('note'));
|
||||
@ -358,7 +358,7 @@ if (empty($reshook))
|
||||
$object->status_buy = 0;
|
||||
$object->id = null;
|
||||
$object->barcode = -1;
|
||||
|
||||
|
||||
if ($object->check())
|
||||
{
|
||||
$id = $object->create($user);
|
||||
@ -405,12 +405,12 @@ if (empty($reshook))
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
if (count($object->errors))
|
||||
if (count($object->errors))
|
||||
{
|
||||
setEventMessage($object->errors, 'errors');
|
||||
dol_print_error($db,$object->errors);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans($object->error), 'errors');
|
||||
dol_print_error($db,$object->error);
|
||||
@ -785,7 +785,7 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
// Batch number management
|
||||
if ($conf->productbatch->enabled)
|
||||
if ($conf->productbatch->enabled)
|
||||
{
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Status").' ('.$langs->trans("Batch").')</td><td colspan="3">';
|
||||
$statutarray=array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"));
|
||||
@ -828,8 +828,8 @@ else
|
||||
// Public URL
|
||||
print '<tr><td valign="top">'.$langs->trans("PublicUrl").'</td><td colspan="3">';
|
||||
print '<input type="text" name="url" size="90" value="'.GETPOST('url').'">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Stock min level
|
||||
if ($type != 1 && ! empty($conf->stock->enabled))
|
||||
{
|
||||
@ -902,7 +902,7 @@ else
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => 3);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
@ -1008,10 +1008,10 @@ else
|
||||
print '<table class="border allwidth">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="20%" class="fieldrequired">'.$langs->trans("Ref").'</td><td colspan="3"><input name="ref" size="20" maxlength="128" value="'.$object->ref.'"></td></tr>';
|
||||
print '<tr><td width="20%" class="fieldrequired">'.$langs->trans("Ref").'</td><td colspan="3"><input name="ref" size="20" maxlength="128" value="'.dol_escape_htmltag($object->ref).'"></td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td colspan="3"><input name="libelle" size="40" maxlength="255" value="'.$object->libelle.'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td colspan="3"><input name="libelle" size="40" maxlength="255" value="'.dol_escape_htmltag($object->libelle).'"></td></tr>';
|
||||
|
||||
// Status To sell
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="3">';
|
||||
@ -1092,7 +1092,7 @@ else
|
||||
print '<tr><td valign="top">'.$langs->trans("PublicUrl").'</td><td colspan="3">';
|
||||
print '<input type="text" name="url" size="80" value="'.$object->url.'">';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Stock
|
||||
if ($object->isproduct() && ! empty($conf->stock->enabled))
|
||||
{
|
||||
@ -1170,7 +1170,7 @@ else
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="2"');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
@ -1437,11 +1437,11 @@ else
|
||||
if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("CustomCode").'</td><td colspan="2">'.$object->customcode.'</td>';
|
||||
|
||||
|
||||
// Origin country code
|
||||
print '<tr><td>'.$langs->trans("CountryOrigin").'</td><td colspan="2">'.getCountry($object->country_id,0,$db).'</td>';
|
||||
}
|
||||
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="'.(2+(($showphoto||$showbarcode)?1:0)).'"');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
@ -1243,66 +1243,6 @@ class Project extends CommonObject
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean tasks not linked to an existing parent
|
||||
*
|
||||
* @return int Nb of records deleted
|
||||
*/
|
||||
function clean_orphelins()
|
||||
{
|
||||
$nb=0;
|
||||
|
||||
// There is orphelins. We clean that
|
||||
$listofid=array();
|
||||
|
||||
// Get list of all id in array listofid
|
||||
$sql='SELECT rowid FROM '.MAIN_DB_PREFIX.'projet_task';
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num && $i < 100)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$listofid[]=$obj->rowid;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
if (count($listofid))
|
||||
{
|
||||
print 'Code asked to check and clean orphelins.';
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task";
|
||||
$sql.= " SET fk_task_parent = 0";
|
||||
$sql.= " WHERE fk_task_parent NOT IN (".join(',',$listofid).")"; // So we update only records linked to a non existing parent
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$nb=$this->db->affected_rows($sql);
|
||||
|
||||
if ($nb > 0)
|
||||
{
|
||||
// Removed orphelins records
|
||||
print 'Some orphelins were found and modified to be parent so records are visible again: ';
|
||||
print join(',',$listofid);
|
||||
}
|
||||
|
||||
return $nb;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associate element to a project
|
||||
|
||||
@ -438,11 +438,19 @@ else
|
||||
{
|
||||
if ($mode=='mine')
|
||||
{
|
||||
if ($nboftaskshown < count($tasksrole)) $object->clean_orphelins();
|
||||
if ($nboftaskshown < count($tasksrole))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
cleanCorruptedTree($db, 'projet_task', 'fk_task_parent');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($nboftaskshown < count($tasksarray)) $object->clean_orphelins();
|
||||
if ($nboftaskshown < count($tasksarray))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
cleanCorruptedTree($db, 'projet_task', 'fk_task_parent');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -317,7 +317,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
// Task parent
|
||||
print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>';
|
||||
print $formother->selectProjectTasks($object->fk_task_parent,$projectstatic->id, 'task_parent', $user->admin?0:1, 0);
|
||||
print $formother->selectProjectTasks($object->fk_task_parent, $projectstatic->id, 'task_parent', ($user->admin?0:1), 0, 0, 0, $object->id);
|
||||
print '</td></tr>';
|
||||
|
||||
// Date start
|
||||
|
||||
@ -92,9 +92,13 @@ if (preg_match('/es/i',$langs->defaultlang)) $urlwiki='http://wiki.dolibarr.org/
|
||||
print '<br>'.$langs->trans("ForDocumentationSeeWiki",$urlwiki,$urlwiki);
|
||||
print '<br>';
|
||||
$urlforum='http://www.dolibarr.org/forum/';
|
||||
if (preg_match('/fr/i',$langs->defaultlang)) $urlforum='http://www.dolibarr.fr/forum/';
|
||||
if (preg_match('/es/i',$langs->defaultlang)) $urlforum='http://www.dolibarr.es/index.php/foro/';
|
||||
print '<br>'.$langs->trans("ForAnswersSeeForum",$urlforum,$urlforum).'<br>';
|
||||
$urlforumlocal='http://www.dolibarr.org/forum/';
|
||||
if (preg_match('/fr/i',$langs->defaultlang)) $urlforumlocal='http://www.dolibarr.fr/forum/';
|
||||
if (preg_match('/es/i',$langs->defaultlang)) $urlforumlocal='http://www.dolibarr.es/index.php/foro/';
|
||||
if (preg_match('/it/i',$langs->defaultlang)) $urlforumlocal='http://www.dolibarr.it/forum/';
|
||||
if (preg_match('/gr/i',$langs->defaultlang)) $urlforumlocal='http://www.dolibarr.gr/forum/';
|
||||
print '<br>'.$langs->trans("ForAnswersSeeForum",$urlforumlocal,$urlforumlocal).'<br>';
|
||||
if ($urlforumlocal != $urlforum) print '<b><a href="'.$urlforum.'">'.$urlforum.'</a></b>';
|
||||
print '</td></tr></table>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -179,7 +179,7 @@ if ($tmpval <= 360) { $colortextbackvmenu='FFF'; }
|
||||
else { $colortextbackvmenu='444'; }
|
||||
$tmppart=explode(',',$colorbacktitle1);
|
||||
$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : '');
|
||||
if ($tmpval <= 360) { $colortexttitle='FFF'; $colorshadowtitle='000'; }
|
||||
if ($tmpval <= 360) { $colortexttitle='FFF'; $colorshadowtitle='888'; }
|
||||
else { $colortexttitle='444'; $colorshadowtitle='FFF'; }
|
||||
$tmppart=explode(',',$colorbacktabcard1);
|
||||
$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : '');
|
||||
@ -855,7 +855,7 @@ form#login {
|
||||
}
|
||||
div#login_left, div#login_right {
|
||||
display: inline-block;
|
||||
min-width: 250px;
|
||||
min-width: 245px;
|
||||
padding-top: 10px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
|
||||
@ -303,7 +303,7 @@ $server->register(
|
||||
* @param int $id Id of object
|
||||
* @param string $ref Ref of object
|
||||
* @param ref_ext $ref_ext Ref external of object
|
||||
* @param $lang $lang Force lang
|
||||
* @param string $lang Lang to force
|
||||
* @return mixed
|
||||
*/
|
||||
function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang='')
|
||||
@ -312,6 +312,9 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang=''
|
||||
|
||||
dol_syslog("Function: getProductOrService login=".$authentication['login']." id=".$id." ref=".$ref." ref_ext=".$ref_ext);
|
||||
|
||||
$langcode=($lang?$lang:(empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT));
|
||||
$langs->setDefaultLang($langcode);
|
||||
|
||||
if ($authentication['entity']) $conf->entity=$authentication['entity'];
|
||||
|
||||
// Init and check authentication
|
||||
@ -347,6 +350,10 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang=''
|
||||
$pdir = get_exdir($product->id,2) . $product->id ."/photos/";
|
||||
$dir = $dir . '/'. $pdir;
|
||||
|
||||
if (! empty($product->multilangs[$langs->defaultlang]["label"])) $product->label = $product->multilangs[$langs->defaultlang]["label"];
|
||||
if (! empty($product->multilangs[$langs->defaultlang]["description"])) $product->description = $product->multilangs[$langs->defaultlang]["description"];
|
||||
if (! empty($product->multilangs[$langs->defaultlang]["note"])) $product->note = $product->multilangs[$langs->defaultlang]["note"];
|
||||
|
||||
// Create
|
||||
$objectresp = array(
|
||||
'result'=>array('result_code'=>'OK', 'result_label'=>''),
|
||||
@ -707,16 +714,20 @@ function getListOfProductsOrServices($authentication,$filterproduct)
|
||||
|
||||
|
||||
/**
|
||||
* getProductsForCategory
|
||||
* Get list of products for a category
|
||||
*
|
||||
* @param array $authentication Array of authentication information
|
||||
* @param array $id Category id
|
||||
* @param $lang $lang Force lang
|
||||
* @return array Array result
|
||||
*/function getProductsForCategory($authentication,$id,$lang='')
|
||||
*/
|
||||
function getProductsForCategory($authentication,$id,$lang='')
|
||||
{
|
||||
global $db,$conf,$langs;
|
||||
|
||||
$langcode=($lang?$lang:(empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT));
|
||||
$langs->setDefaultLang($langcode);
|
||||
|
||||
dol_syslog("Function: getProductsForCategory login=".$authentication['login']." id=".$id);
|
||||
|
||||
if ($authentication['entity']) $conf->entity=$authentication['entity'];
|
||||
@ -773,11 +784,11 @@ function getListOfProductsOrServices($authentication,$filterproduct)
|
||||
'id' => $obj->id,
|
||||
'ref' => $obj->ref,
|
||||
'ref_ext' => $obj->ref_ext,
|
||||
'label' => $obj->label,
|
||||
'description' => $obj->description,
|
||||
'label' => ! empty($obj->multilangs[$langs->defaultlang]["label"]) ? $obj->multilangs[$langs->defaultlang]["label"] : $obj->label,
|
||||
'description' => ! empty($obj->multilangs[$langs->defaultlang]["description"]) ? $obj->multilangs[$langs->defaultlang]["description"] : $obj->description,
|
||||
'date_creation' => dol_print_date($obj->date_creation,'dayhourrfc'),
|
||||
'date_modification' => dol_print_date($obj->date_modification,'dayhourrfc'),
|
||||
'note' => $obj->note,
|
||||
'note' => ! empty($obj->multilangs[$langs->defaultlang]["note"]) ? $obj->multilangs[$langs->defaultlang]["note"] : $obj->note,
|
||||
'status_tosell' => $obj->status,
|
||||
'status_tobuy' => $obj->status_buy,
|
||||
'type' => $obj->type,
|
||||
|
||||