Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
7dab06952c
16
ChangeLog
16
ChangeLog
@ -5,6 +5,7 @@ English Dolibarr ChangeLog
|
||||
|
||||
***** ChangeLog for 3.7 compared to 3.6.* *****
|
||||
For users:
|
||||
- New: Add number of active notification into tab title (like we do for notes and documents)
|
||||
- New: Can add product into category from category card.
|
||||
- New: PDF event report show project and status of event.
|
||||
- New: Can filter on status on interventions.
|
||||
@ -135,7 +136,14 @@ Dolibarr better:
|
||||
creation of a pdf or odt, hook "afterPDFCreation" or "afterODTCreation" must be used instead.
|
||||
- A lot of pages called fiche.php were renamed into card.php
|
||||
- A lot of pages called liste.php were renamed into list.php
|
||||
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.6.2 compared to 3.6.1 *****
|
||||
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice
|
||||
- Fix: bug 1588 : relative discount
|
||||
- Fix: label of input method not tranlated.
|
||||
|
||||
***** ChangeLog for 3.6.1 compared to 3.6.* *****
|
||||
For users:
|
||||
- Fix: Can upload files on services.
|
||||
@ -154,7 +162,13 @@ For users:
|
||||
- Fix: Extrafield feature select from table should try to translate multiple column when not needed
|
||||
- Fix: cents for indian ruppes are calle paisa and paise.
|
||||
- Fix: Invoices payments may be older than invoices.
|
||||
- Fix: Withdrawal total amount is double
|
||||
- Fix: [ bug #1593 ] Spanish Localtax IRPF not being calculated since 3.6.0 in supplier invoices when adding a line
|
||||
- Fix: Web service categorie WDSL declaration is correct
|
||||
- Fix: ErrorBadValueForParamNotAString was displayed in virtual product if no base price defined
|
||||
- Fix: Category creation failed and no message output
|
||||
- Fix: Lanf for Payment Type
|
||||
- Fix: PHPCheckstyle 1.5.5
|
||||
|
||||
***** ChangeLog for 3.6 compared to 3.5.* *****
|
||||
For users:
|
||||
|
||||
@ -442,6 +442,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
||||
|
||||
@ -65,8 +65,7 @@ if ($action == 'delete') {
|
||||
$accounting = new AccountingAccount($db);
|
||||
|
||||
if ($action == 'disable') {
|
||||
$accounting = $accounting->fetch($id);
|
||||
if (! empty($accounting->id)) {
|
||||
if ($accounting->fetch($id)) {
|
||||
$result = $accounting->account_desactivate($id);
|
||||
}
|
||||
|
||||
@ -75,10 +74,7 @@ if ($action == 'disable') {
|
||||
setEventMessage($accounting->error, 'errors');
|
||||
}
|
||||
} else if ($action == 'enable') {
|
||||
|
||||
$accounting = $accounting->fetch($id);
|
||||
|
||||
if (! empty($accounting->id)) {
|
||||
if ($accounting->fetch($id)) {
|
||||
$result = $accounting->account_activate($id);
|
||||
}
|
||||
$action = 'update';
|
||||
@ -160,7 +156,7 @@ if ($result) {
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$var = True;
|
||||
$var = true;
|
||||
|
||||
while ( $i < min($num, $limit) ) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
@ -99,7 +99,7 @@ print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
$var = True;
|
||||
$var = true;
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">' . $langs->trans("Modelcsv") . '</td>';
|
||||
|
||||
@ -135,7 +135,7 @@ if ($result) {
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||
print '<input type="hidden" name="action" value="import">';
|
||||
|
||||
$var = True;
|
||||
$var = true;
|
||||
while ( $i < min($num_lines, $limit) ) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$var = ! $var;
|
||||
|
||||
@ -191,7 +191,7 @@ print "<br>\n";
|
||||
* Define Chart of accounts
|
||||
*/
|
||||
print '<table class="noborder" width="100%">';
|
||||
$var = True;
|
||||
$var = true;
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">';
|
||||
@ -211,7 +211,7 @@ $sql .= " AND fk_pays = " . $mysoc->country_id;
|
||||
dol_syslog('accountancy/admin/index.php:: $sql=' . $sql);
|
||||
$resql = $db->query($sql);
|
||||
|
||||
$var = True;
|
||||
$var = true;
|
||||
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
@ -89,7 +89,7 @@ if ($resql) {
|
||||
print '<td align="left">' . $langs->trans("Accountancy_code_sell") . '</td>';
|
||||
print '<td align="left">' . $langs->trans("Accountancy_code_sell_suggest") . '</td>';
|
||||
|
||||
$var = True;
|
||||
$var = true;
|
||||
|
||||
while ( $i < min($num, 250) ) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
@ -227,9 +227,8 @@ if ($result) {
|
||||
$i ++;
|
||||
}
|
||||
|
||||
print '<tr><td colspan="8"> </td></tr><tr><td colspan="8" align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '"></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '<br><div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '"></div>';
|
||||
print '</form>';
|
||||
} else {
|
||||
print $db->error();
|
||||
|
||||
@ -208,10 +208,8 @@ if ($result) {
|
||||
$i ++;
|
||||
}
|
||||
|
||||
print '<tr><td colspan="8"> </td></tr><tr><td colspan="8" align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventiler") . '"></td></tr>';
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '</table>';
|
||||
print '<br><div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '"></div>';
|
||||
print '</form>';
|
||||
} else {
|
||||
print $db->error();
|
||||
|
||||
@ -219,6 +219,10 @@ if (function_exists("ldap_connect"))
|
||||
$info=$object->_load_ldap_info();
|
||||
$dn=$object->_load_ldap_dn($info);
|
||||
|
||||
// Get a gid number for objectclass PosixGroup
|
||||
if(in_array('posixGroup',$info['objectclass']))
|
||||
$info['gidNumber'] = $ldap->getNextGroupGid();
|
||||
|
||||
$result1=$ldap->delete($dn); // To be sure to delete existing records
|
||||
$result2=$ldap->add($dn,$info,$user); // Now the test
|
||||
$result3=$ldap->delete($dn); // Clean what we did
|
||||
|
||||
@ -144,6 +144,10 @@ if ($action == 'add' && $user->rights->categorie->creer)
|
||||
$action = 'confirmed';
|
||||
$_POST["addcat"] = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -770,12 +770,12 @@ else if ($action == 'addline' && $user->rights->propal->creer) {
|
||||
// On defini prix unitaire
|
||||
if (! empty($conf->global->PRODUIT_MULTIPRICES) && $object->thirdparty->price_level)
|
||||
{
|
||||
$pu_ht = $prod->multiprices [$object->thirdparty->price_level];
|
||||
$pu_ttc = $prod->multiprices_ttc [$object->thirdparty->price_level];
|
||||
$price_min = $prod->multiprices_min [$object->thirdparty->price_level];
|
||||
$price_base_type = $prod->multiprices_base_type [$object->thirdparty->price_level];
|
||||
$tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
|
||||
$tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
|
||||
$pu_ht = $prod->multiprices[$object->thirdparty->price_level];
|
||||
$pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level];
|
||||
$price_min = $prod->multiprices_min[$object->thirdparty->price_level];
|
||||
$price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
|
||||
if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
|
||||
if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
|
||||
}
|
||||
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
{
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2012-214 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
@ -802,7 +802,10 @@ class Propal extends CommonObject
|
||||
$fk_parent_line,
|
||||
$this->lines[$i]->fk_fournprice,
|
||||
$this->lines[$i]->pa_ht,
|
||||
$this->lines[$i]->label
|
||||
$this->lines[$i]->label,
|
||||
$this->lines[$i]->date_start,
|
||||
$this->lines[$i]->date_end,
|
||||
$this->lines[$i]->array_options
|
||||
);
|
||||
|
||||
if ($result < 0)
|
||||
@ -932,6 +935,10 @@ class Propal extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// get extrafields so they will be clone
|
||||
foreach($this->lines as $line)
|
||||
$line->fetch_optionals($line->rowid);
|
||||
|
||||
// Load source object
|
||||
$objFrom = dol_clone($this);
|
||||
|
||||
@ -1070,7 +1077,7 @@ class Propal extends CommonObject
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON p.fk_input_reason = dr.rowid';
|
||||
$sql.= " WHERE p.fk_statut = c.id";
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
if ($ref) $sql.= " AND p.ref='".$this->db->escape($ref)."'";
|
||||
if ($ref) $sql.= " AND p.ref='".$ref."'";
|
||||
else $sql.= " AND p.rowid=".$rowid;
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
|
||||
@ -600,10 +600,12 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
|
||||
// multiprix
|
||||
if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level))
|
||||
{
|
||||
$pu_ht = $prod->multiprices [$object->thirdparty->price_level];
|
||||
$pu_ttc = $prod->multiprices_ttc [$object->thirdparty->price_level];
|
||||
$price_min = $prod->multiprices_min [$object->thirdparty->price_level];
|
||||
$price_base_type = $prod->multiprices_base_type [$object->thirdparty->price_level];
|
||||
$pu_ht = $prod->multiprices[$object->thirdparty->price_level];
|
||||
$pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level];
|
||||
$price_min = $prod->multiprices_min[$object->thirdparty->price_level];
|
||||
$price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
|
||||
if (isset($prod->multiprices_tva_tx[$object->client->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->client->price_level];
|
||||
if (isset($prod->multiprices_recuperableonly[$object->client->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level];
|
||||
$tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
|
||||
$tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
|
||||
}
|
||||
@ -616,14 +618,20 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
|
||||
$filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id);
|
||||
|
||||
$result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
|
||||
if ($result) {
|
||||
if (count($prodcustprice->lines) > 0) {
|
||||
if ($result >= 0)
|
||||
{
|
||||
if (count($prodcustprice->lines) > 0)
|
||||
{
|
||||
$pu_ht = price($prodcustprice->lines [0]->price);
|
||||
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
|
||||
$price_base_type = $prodcustprice->lines [0]->price_base_type;
|
||||
$prod->tva_tx = $prodcustprice->lines [0]->tva_tx;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($prodcustprice->error,'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// if price ht is forced (ie: calculated by margin rate and cost price)
|
||||
@ -1875,9 +1883,9 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
|
||||
// Local taxes
|
||||
if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0)
|
||||
$nbrow ++;
|
||||
$nbrow++;
|
||||
if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0 )
|
||||
$nbrow ++;
|
||||
$nbrow++;
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
@ -2529,7 +2537,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
|
||||
if (is_array($contactarr) && count($contactarr) > 0) {
|
||||
foreach ($contactarr as $contact) {
|
||||
if ($contact ['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { // TODO Use code and not label
|
||||
if ($contact['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { // TODO Use code and not label
|
||||
$contactstatic = new Contact($db);
|
||||
$contactstatic->fetch($contact ['id']);
|
||||
$custcontact = $contactstatic->getFullName($langs, 1);
|
||||
@ -2537,15 +2545,15 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
}
|
||||
|
||||
if (! empty($custcontact)) {
|
||||
$formmail->substit ['__CONTACTCIVNAME__'] = $custcontact;
|
||||
$formmail->substit['__CONTACTCIVNAME__'] = $custcontact;
|
||||
}
|
||||
}
|
||||
|
||||
// Tableau des parametres complementaires
|
||||
$formmail->param ['action'] = 'send';
|
||||
$formmail->param ['models'] = 'order_send';
|
||||
$formmail->param ['orderid'] = $object->id;
|
||||
$formmail->param ['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
|
||||
$formmail->param['action'] = 'send';
|
||||
$formmail->param['models'] = 'order_send';
|
||||
$formmail->param['orderid'] = $object->id;
|
||||
$formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
|
||||
|
||||
// Init list of files
|
||||
if (GETPOST("mode") == 'init') {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
@ -726,7 +726,8 @@ class Commande extends CommonOrder
|
||||
$fk_parent_line,
|
||||
$this->lines[$i]->fk_fournprice,
|
||||
$this->lines[$i]->pa_ht,
|
||||
$this->lines[$i]->label
|
||||
$this->lines[$i]->label,
|
||||
$this->lines[$i]->array_options
|
||||
);
|
||||
if ($result < 0)
|
||||
{
|
||||
@ -863,6 +864,10 @@ class Commande extends CommonOrder
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// get extrafields so they will be clone
|
||||
foreach($this->lines as $line)
|
||||
$line->fetch_optionals($line->rowid);
|
||||
|
||||
// Load source object
|
||||
$objFrom = dol_clone($this);
|
||||
|
||||
|
||||
@ -146,7 +146,7 @@ if ($resql)
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
$var=true;
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
|
||||
@ -187,7 +187,7 @@ if (! empty($conf->commande->enabled))
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$var = True;
|
||||
$var = true;
|
||||
while ($i < $num)
|
||||
{
|
||||
$var=!$var;
|
||||
@ -238,7 +238,7 @@ if ($resql)
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$var = True;
|
||||
$var = true;
|
||||
while ($i < $num)
|
||||
{
|
||||
$var=!$var;
|
||||
@ -308,7 +308,7 @@ if (! empty($conf->commande->enabled))
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$var = True;
|
||||
$var = true;
|
||||
while ($i < $num)
|
||||
{
|
||||
$var=!$var;
|
||||
@ -379,7 +379,7 @@ if (! empty($conf->commande->enabled))
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$var = True;
|
||||
$var = true;
|
||||
while ($i < $num)
|
||||
{
|
||||
$var=!$var;
|
||||
|
||||
@ -622,7 +622,7 @@ if (($action != 'create' && $action != 'add') || !$error)
|
||||
print '</form>';
|
||||
|
||||
print '<form name="orders2invoice" action="orderstoinvoice.php" method="GET">';
|
||||
$var=True;
|
||||
$var=true;
|
||||
$generic_commande = new Commande($db);
|
||||
|
||||
while ($i < $num)
|
||||
|
||||
@ -177,7 +177,7 @@ if ($resql)
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
$var=true;
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
|
||||
@ -1201,8 +1201,8 @@ else if ($action == 'addline' && $user->rights->facture->creer)
|
||||
$pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level];
|
||||
$price_min = $prod->multiprices_min[$object->thirdparty->price_level];
|
||||
$price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
|
||||
//$tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
|
||||
//$tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
|
||||
if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
|
||||
if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
|
||||
}
|
||||
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
{
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
@ -394,7 +394,7 @@ class Facture extends CommonInvoice
|
||||
$this->lines[$i]->fk_fournprice,
|
||||
$this->lines[$i]->pa_ht,
|
||||
$this->lines[$i]->label,
|
||||
''
|
||||
$this->lines[$i]->array_options
|
||||
);
|
||||
if ($result < 0)
|
||||
{
|
||||
@ -591,6 +591,10 @@ class Facture extends CommonInvoice
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// get extrafields so they will be clone
|
||||
foreach($this->lines as $line)
|
||||
$line->fetch_optionals($line->rowid);
|
||||
|
||||
// Load source object
|
||||
$objFrom = dol_clone($this);
|
||||
|
||||
|
||||
@ -228,7 +228,7 @@ if ($action == 'create')
|
||||
if (empty($conf->global->PRODUIT_MULTIPRICES)) print '<td align="right">'.$langs->trans("CurrentProductPrice").'</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
$var=True;
|
||||
$var=true;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
@ -447,7 +447,7 @@ else
|
||||
|
||||
$num = count($object->lines);
|
||||
$i = 0;
|
||||
$var=True;
|
||||
$var=true;
|
||||
while ($i < $num)
|
||||
{
|
||||
$var=!$var;
|
||||
@ -572,7 +572,7 @@ else
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
$var=True;
|
||||
$var=true;
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
@ -600,7 +600,7 @@ if ($resql)
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
$var=True;
|
||||
$var=true;
|
||||
$total_ht=0;
|
||||
$total_tva=0;
|
||||
$total_ttc=0;
|
||||
|
||||
@ -333,7 +333,7 @@ if ($resql)
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
$var=True;
|
||||
$var=true;
|
||||
$total_ht=0;
|
||||
$total_tva=0;
|
||||
$total_ttc=0;
|
||||
|
||||
@ -491,7 +491,7 @@ if ($object->id > 0)
|
||||
print '<td align="center">'.$langs->trans("WithdrawalReceipt").'</td>';
|
||||
print '<td align="center">'.$langs->trans("User").'</td><td> </td><td> </td>';
|
||||
print '</tr>';
|
||||
$var=True;
|
||||
$var=true;
|
||||
|
||||
if ($result_sql)
|
||||
{
|
||||
|
||||
@ -494,7 +494,7 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire)
|
||||
print '</tr>';
|
||||
if ($num)
|
||||
{
|
||||
$var = True;
|
||||
$var = true;
|
||||
$total_ttc = $totalam = $total = 0;
|
||||
|
||||
$var=true;
|
||||
@ -908,7 +908,7 @@ if ($resql)
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("TasksToDo").'</td>';
|
||||
print "</tr>\n";
|
||||
$var = True;
|
||||
$var = true;
|
||||
$i = 0;
|
||||
while ($i < $db->num_rows($resql))
|
||||
{
|
||||
|
||||
@ -509,7 +509,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
$var=true;
|
||||
$total=0;
|
||||
$totalrecu=0;
|
||||
$totalrecucreditnote=0;
|
||||
@ -687,7 +687,7 @@ if (! GETPOST('action'))
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$var=True;
|
||||
$var=true;
|
||||
|
||||
print_barre_liste($langs->trans('Payments'), $page, $_SERVER["PHP_SELF"],'',$sortfield,$sortorder,'',$num);
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
@ -253,7 +253,7 @@ if ($_GET["action"] == 'create')
|
||||
print '<td align="center">'.$langs->trans("Amount").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
$var=true;
|
||||
$total=0;
|
||||
$totalrecu=0;
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -1342,7 +1343,7 @@ class BonPrelevement extends CommonObject
|
||||
fputs($this->file, ' </CstmrDrctDbtInitn>'.$CrLf);
|
||||
fputs($this->file, '</Document>'.$CrLf);
|
||||
|
||||
$sql = "SELECT pl.amount";
|
||||
/*$sql = "SELECT pl.amount";
|
||||
$sql.= " FROM";
|
||||
$sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."facture as f,";
|
||||
@ -1368,7 +1369,7 @@ class BonPrelevement extends CommonObject
|
||||
else
|
||||
{
|
||||
$result = -2;
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -350,7 +350,7 @@ if ($id > 0)
|
||||
* Payments
|
||||
*/
|
||||
$sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,";
|
||||
$sql.= "c.libelle as paiement_type";
|
||||
$sql.= "c.code as type_code,c.libelle as paiement_type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."c_paiement as c ";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
@ -383,8 +383,9 @@ if ($id > 0)
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>';
|
||||
print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
print "<td>".$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td>\n";
|
||||
$labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type;
|
||||
print "<td>".$labeltype.' '.$objp->num_paiement."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td>\n";
|
||||
print "</tr>";
|
||||
$totalpaye += $objp->amount;
|
||||
$i++;
|
||||
|
||||
@ -241,13 +241,20 @@ if (empty($reshook))
|
||||
$result = $object->delete();
|
||||
if ($result > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/contact/list.php');
|
||||
exit;
|
||||
if ($backtopage)
|
||||
{
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/contact/list.php');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessage($object->errors,'errors');
|
||||
setEventMessage($object->error,$object->errors,'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -360,7 +367,7 @@ else
|
||||
{
|
||||
if ($action == 'delete')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id.($backtopage?'&backtopage='.$backtopage:''),$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1082,27 +1089,27 @@ else
|
||||
{
|
||||
if ($user->rights->societe->contact->creer)
|
||||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=edit">'.$langs->trans('Modify').'</a>';
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=edit">'.$langs->trans('Modify').'</a>';
|
||||
}
|
||||
|
||||
if (! $object->user_id && $user->rights->user->user->creer)
|
||||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>';
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>';
|
||||
}
|
||||
|
||||
if ($user->rights->societe->contact->supprimer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="card.php?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>';
|
||||
print '<a class="butActionDelete" href="card.php?id='.$object->id.'&action=delete'.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
// Activer
|
||||
if ($object->statut == 0 && $user->rights->societe->contact->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable">'.$langs->trans("Reactivate").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable">'.$langs->trans("Reactivate").'</a>';
|
||||
}
|
||||
// Desactiver
|
||||
if ($object->statut == 1 && $user->rights->societe->contact->creer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=disable&id='.$object->id.'">'.$langs->trans("DisableUser").'</a>';
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=disable&id='.$object->id.'">'.$langs->trans("DisableUser").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -877,20 +877,21 @@ class Contact extends CommonObject
|
||||
* @param int $withpicto Include picto with link
|
||||
* @param string $option Where the link point to
|
||||
* @param int $maxlen Max length of
|
||||
* @param string $moreparam Add more param into URL
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='',$maxlen=0)
|
||||
function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$result='';
|
||||
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.'">';
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'">';
|
||||
$lienfin='</a>';
|
||||
|
||||
if ($option == 'xxx')
|
||||
{
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.'">';
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'">';
|
||||
$lienfin='</a>';
|
||||
}
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ $extrasize=GETPOST('size');
|
||||
if (GETPOST('type')=='double' && strpos($extrasize,',')===false) $extrasize='24,8';
|
||||
if (GETPOST('type')=='date') $extrasize='';
|
||||
if (GETPOST('type')=='datetime') $extrasize='';
|
||||
if (GETPOST('type')=='select') $extrasize='';
|
||||
if (GETPOST('type')=='select') $extrasize='';
|
||||
|
||||
|
||||
// Add attribute
|
||||
@ -87,7 +87,7 @@ if ($action == 'add')
|
||||
$mesg[]=$langs->trans("ErrorNoValueForRadioType");
|
||||
$action = 'create';
|
||||
}
|
||||
if (((GETPOST('type')=='radio') || (GETPOST('type')=='checkbox')) && GETPOST('param'))
|
||||
if (((GETPOST('type')=='radio') || (GETPOST('type')=='checkbox')) && GETPOST('param'))
|
||||
{
|
||||
// Construct array for parameter (value of select list)
|
||||
$parameters = GETPOST('param');
|
||||
@ -95,7 +95,7 @@ if ($action == 'add')
|
||||
foreach($parameters_array as $param_ligne)
|
||||
{
|
||||
if (!empty($param_ligne)) {
|
||||
if (preg_match_all('/,/',$param_ligne,$matches))
|
||||
if (preg_match_all('/,/',$param_ligne,$matches))
|
||||
{
|
||||
if (count($matches[0])>1) {
|
||||
$error++;
|
||||
@ -104,7 +104,7 @@ if ($action == 'add')
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
@ -112,12 +112,12 @@ if ($action == 'add')
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// attrname must be alphabetical and lower case only
|
||||
// attrname must be alphabetical and lower case only
|
||||
if (isset($_POST["attrname"]) && preg_match("/^[a-z0-9-_]+$/",$_POST['attrname']))
|
||||
{
|
||||
// Construct array for parameter (value of select list)
|
||||
@ -139,8 +139,8 @@ if ($action == 'add')
|
||||
list($key,$value) = explode(',',$param_ligne);
|
||||
$params['options'][$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$result=$extrafields->addExtraField($_POST['attrname'],$_POST['label'],$_POST['type'],$_POST['pos'],$extrasize,$elementtype,(GETPOST('unique')?1:0),(GETPOST('required')?1:0),$default_value,$params);
|
||||
if ($result > 0)
|
||||
{
|
||||
@ -164,7 +164,7 @@ if ($action == 'add')
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
setEventMessage($mesg,'errors');
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ class ExtraFields
|
||||
{
|
||||
$table=$elementtype.'_extrafields';
|
||||
|
||||
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname))
|
||||
if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname))
|
||||
{
|
||||
if ($type=='boolean') {
|
||||
$typedb='int';
|
||||
@ -226,8 +226,7 @@ class ExtraFields
|
||||
// Clean parameters
|
||||
if (empty($pos)) $pos=0;
|
||||
|
||||
|
||||
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname))
|
||||
if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname))
|
||||
{
|
||||
if(is_array($param) and count($param) > 0)
|
||||
{
|
||||
|
||||
@ -3987,7 +3987,7 @@ class Form
|
||||
{
|
||||
print '<input type="text" size="3" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').' class="flat" value="'.((int) $hourSelected).'">';
|
||||
}
|
||||
print $langs->trans('Hours');
|
||||
print ' '.$langs->trans('HourShort');
|
||||
|
||||
if ($minunderhours) print '<br>';
|
||||
else print " ";
|
||||
@ -4000,7 +4000,7 @@ class Form
|
||||
print '>'.$min.'</option>';
|
||||
}
|
||||
print "</select>";
|
||||
print $langs->trans('Minutes'). " ";
|
||||
print ' '.$langs->trans('MinuteShort'). " ";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -474,14 +474,14 @@ class FormFile
|
||||
// Model
|
||||
if (! empty($modellist))
|
||||
{
|
||||
$out.= '<th align="center" class="formdoc liste_titre">';
|
||||
$out.= '<th align="center" class="formdoc liste_titre maxwidthonsmartphone">';
|
||||
$out.= '<span class="hideonsmartphone">'.$langs->trans('Model').' </span>';
|
||||
if (is_array($modellist) && count($modellist) == 1) // If there is only one element
|
||||
{
|
||||
$arraykeys=array_keys($modellist);
|
||||
$modelselected=$arraykeys[0];
|
||||
}
|
||||
$out.= $form->selectarray('model',$modellist,$modelselected,$showempty,0,0);
|
||||
$out.= $form->selectarray('model', $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', '');
|
||||
$out.= '</th>';
|
||||
}
|
||||
else
|
||||
@ -492,7 +492,7 @@ class FormFile
|
||||
}
|
||||
|
||||
// Language code (if multilang)
|
||||
$out.= '<th align="center" class="formdoc liste_titre">';
|
||||
$out.= '<th align="center" class="formdoc liste_titre maxwidthonsmartphone">';
|
||||
if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang && (! empty($modellist) || $showempty))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
@ -508,7 +508,7 @@ class FormFile
|
||||
|
||||
// Button
|
||||
$addcolumforpicto=($delallowed || $printer || $morepicto);
|
||||
$out.= '<th align="center" colspan="'.($addcolumforpicto?'2':'1').'" class="formdocbutton liste_titre">';
|
||||
$out.= '<th align="center" colspan="'.($addcolumforpicto?'2':'1').'" class="formdocbutton liste_titre maxwidthonsmartphone">';
|
||||
$genbutton = '<input class="button" id="'.$forname.'_generatebutton" name="'.$forname.'_generatebutton"';
|
||||
$genbutton.= ' type="submit" value="'.$buttonlabel.'"';
|
||||
if (! $allowgenifempty && ! is_array($modellist) && empty($modellist)) $genbutton.= ' disabled="disabled"';
|
||||
@ -629,7 +629,7 @@ class FormFile
|
||||
|
||||
if (count($file_list) == 0 && $headershown)
|
||||
{
|
||||
$out.='<tr><td colspan="3">'.$langs->trans("None").'</td></tr>';
|
||||
$out.='<tr '.$bc[0].'><td colspan="3">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
$this->numoffiles++;
|
||||
@ -1150,7 +1150,7 @@ class FormFile
|
||||
$nboflinks = count($links);
|
||||
if ($nboflinks > 0) include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
|
||||
$var = true;
|
||||
$var = false;
|
||||
foreach ($links as $link)
|
||||
{
|
||||
$var =! $var;
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
function societe_prepare_head($object)
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
global $db, $langs, $conf, $user;
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
@ -109,8 +109,29 @@ function societe_prepare_head($object)
|
||||
// Notifications
|
||||
if (! empty($conf->notification->enabled))
|
||||
{
|
||||
$nbNote = 0;
|
||||
$sql = "SELECT COUNT(n.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n";
|
||||
$sql.= " WHERE fk_soc = ".$object->id;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$nbNote=$obj->nb;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Notifications");
|
||||
if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
|
||||
$head[$h][2] = 'notify';
|
||||
$h++;
|
||||
}
|
||||
@ -676,7 +697,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
$contactstatic->lastname = $obj->lastname;
|
||||
$contactstatic->firstname = $obj->firstname;
|
||||
$contactstatic->civility_id = $obj->civility_id;
|
||||
print $contactstatic->getNomUrl(1);
|
||||
print $contactstatic->getNomUrl(1,'',0,'&backtopage='.urlencode($backtopage));
|
||||
print '</td>';
|
||||
|
||||
print '<td>'.$obj->poste.'</td>';
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
@ -479,6 +479,50 @@ function clean_url($url,$http=1)
|
||||
else return $url;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns an email value with obfuscated parts.
|
||||
*
|
||||
* @param string $mail Email
|
||||
* @param string $replace Replacement character (defaul : *)
|
||||
* @param int $nbreplace Number of replacement character (default : 8)
|
||||
* @param int $nbdisplaymail Number of character unchanged (default: 4)
|
||||
* @param int $nbdisplaydomain Number of character unchanged of domain (default: 3)
|
||||
* @param bool $displaytld Display tld (default: true)
|
||||
* @return string Return email with hidden parts or '';
|
||||
*/
|
||||
function dolObfuscateEmail($mail, $replace="*", $nbreplace=8, $nbdisplaymail=4, $nbdisplaydomain=3, $displaytld=true)
|
||||
{
|
||||
if(!isValidEmail($mail))return '';
|
||||
$tab = explode('@', $mail);
|
||||
$tab2 = explode('.',$tab[1]);
|
||||
$string_replace = '';
|
||||
$mail_name = $tab[0];
|
||||
$mail_domaine = $tab2[0];
|
||||
$mail_tld = '';
|
||||
|
||||
for($i=1; $i < count($tab2) && $displaytld ;$i++)
|
||||
{
|
||||
$mail_tld .= '.'.$tab2[$i];
|
||||
}
|
||||
|
||||
for($i=0; $i < $nbreplace; $i++){
|
||||
$string_replace .= $replace;
|
||||
}
|
||||
|
||||
if(strlen($mail_name) > $nbdisplaymail){
|
||||
$mail_name = substr($mail_name, 0, $nbdisplaymail);
|
||||
}
|
||||
|
||||
if(strlen($mail_domaine) > $nbdisplaydomain){
|
||||
$mail_domaine = substr($mail_domaine, strlen($mail_domaine)-$nbdisplaydomain);
|
||||
}
|
||||
|
||||
return $mail_name . $string_replace . $mail_domaine . $mail_tld;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return lines of an html table from an array
|
||||
* Used by array2table function only
|
||||
|
||||
@ -72,6 +72,13 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea
|
||||
curl_setopt($ch, CURLOPT_POST, 1); // POST
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $param); // Setting param x=a&y=z as POST fields
|
||||
}
|
||||
else if ($postorget == 'PUT')
|
||||
{
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT'
|
||||
if ( ! is_array($param) )
|
||||
parse_str($param, $array_param);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array_param)); // Setting param x=a&y=z as PUT fields
|
||||
}
|
||||
else if ($postorget == 'HEAD')
|
||||
{
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD'); // HTTP request is 'HEAD'
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
@ -445,7 +445,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
*
|
||||
* @param string $inc ?
|
||||
* @param string $parent ?
|
||||
* @param Object $lines ?
|
||||
* @param Task[] $lines ?
|
||||
* @param int $level ?
|
||||
* @param string $projectsrole ?
|
||||
* @param string $tasksrole ?
|
||||
@ -455,8 +455,14 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
*/
|
||||
function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=0)
|
||||
{
|
||||
global $user, $bc, $langs;
|
||||
global $form, $projectstatic, $taskstatic;
|
||||
global $db, $user, $bc, $langs;
|
||||
global $form, $formother, $projectstatic, $taskstatic;
|
||||
|
||||
if (! is_object($formother))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
$formother = new FormOther($db);
|
||||
}
|
||||
|
||||
$lastprojectid=0;
|
||||
|
||||
@ -526,7 +532,7 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
|
||||
|
||||
// Progress declared %
|
||||
print '<td align="right">';
|
||||
print $lines[$i]->progress.' %';
|
||||
print $formother->select_percent($lines[$i]->progress, $lines[$i]->id . 'progress');
|
||||
print '</td>';
|
||||
|
||||
// Time spent
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003,2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2009-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
@ -394,7 +394,7 @@ class modAgenda extends DolibarrModules
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s on ac.fk_soc = s.rowid';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co on s.fk_pays = co.rowid';
|
||||
$this->export_sql_end[$r] .=' Where ac.entity = '.$conf->entity;
|
||||
$this->export_sql_end[$r] .=' ORDER BY datep';
|
||||
$this->export_sql_end[$r] .=' ORDER BY ac.datep';
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -182,7 +182,7 @@ class modBanque extends DolibarrModules
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture as f ON f.rowid = pf.fk_facture';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON f.fk_soc = s.rowid';
|
||||
$this->export_sql_end[$r] .=' WHERE ba.rowid = b.fk_account AND bch.rowid = b.fk_bordereau and bch.fk_bank_account=ba.rowid';
|
||||
$this->export_sql_end[$r] .=' AND b.fk_type = "CHQ"';
|
||||
$this->export_sql_end[$r] .=" AND b.fk_type = 'CHQ'";
|
||||
$this->export_sql_end[$r] .=' AND p.fk_paiement = 7';
|
||||
$this->export_sql_end[$r] .=' AND ba.entity = '.$conf->entity;
|
||||
$this->export_sql_order[$r] =' ORDER BY b.datev, b.num_releve';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -41,6 +41,8 @@ class modContrat extends DolibarrModules
|
||||
*/
|
||||
function __construct($db)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->db = $db;
|
||||
$this->numero = 54;
|
||||
|
||||
@ -114,6 +116,53 @@ class modContrat extends DolibarrModules
|
||||
$this->rights[5][3] = 0;
|
||||
$this->rights[5][4] = 'supprimer';
|
||||
|
||||
// Exports
|
||||
//--------
|
||||
$r=1;
|
||||
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]='ContractAndServices'; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->export_icon[$r]='contract';
|
||||
$this->export_permission[$r]=array(array("contrat","export"));
|
||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode',
|
||||
's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode',
|
||||
's.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra',
|
||||
'co.rowid'=>"contractId",'co.ref'=>"contactRef",'co.datec'=>"contractDateCreation",'co.date_contrat'=>"DateContract",'co.mise_en_service'=>"DateMiseService",
|
||||
'co.fin_validite'=>"EndValidity",'co.date_cloture'=>"Cloture",'co.note_private'=>"NotePrivate",'co.note_public'=>"NotePublic",
|
||||
'cod.rowid'=>'LineId','cod.label'=>"LineLabel",'cod.description'=>"LineDescription",'cod.price_ht'=>"LineUnitPrice",'cod.tva_tx'=>"LineVATRate",
|
||||
'cod.qty'=>"LineQty",'cod.total_ht'=>"LineTotalHT",'cod.total_tva'=>"LineTotalVAT",'cod.total_ttc'=>"LineTotalTTC",
|
||||
'cod.date_ouverture'=>"DateStart",'cod.date_ouverture_prevue'=>"DateStartPrevis",'cod.date_fin_validite'=>"EndValidity",'cod.date_cloture'=>"DateEnd",
|
||||
'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
|
||||
|
||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company',
|
||||
's.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company',
|
||||
's.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company',
|
||||
'co.rowid'=>"Contract",'co.ref'=>"Contract",'co.datec'=>"Contract",'co.date_contrat'=>"Contract",'co.mise_en_service'=>"Contract",
|
||||
'co.fin_validite'=>"Contract",'co.date_cloture'=>"Contract",'co.note_private'=>"Contract",'co.note_public'=>"Contract",
|
||||
'cod.rowid'=>'contract_line','cod.label'=>"contract_line",'cod.description'=>"contract_line",'cod.price_ht'=>"contract_line",'cod.tva_tx'=>"contract_line",
|
||||
'cod.qty'=>"contract_line",'cod.total_ht'=>"contract_line",'cod.total_tva'=>"contract_line",'cod.total_ttc'=>"contract_line",
|
||||
'cod.date_ouverture'=>"contract_line",'cod.date_ouverture_prevue'=>"contract_line",'cod.date_fin_validite'=>"contract_line",'cod.date_cloture'=>"contract_line",
|
||||
'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
|
||||
|
||||
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text',
|
||||
's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text',
|
||||
's.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text',
|
||||
'co.ref'=>"Text",'co.datec'=>"Date",'co.date_contrat'=>"Date",'co.mise_en_service'=>"Date",
|
||||
'co.fin_validite'=>"Date",'co.date_cloture'=>"Date",'co.note_private'=>"Text",'co.note_public'=>"Text",
|
||||
'cod.label'=>"Text",'cod.description'=>"Text",'cod.price_ht'=>"Numeric",'cod.tva_tx'=>"Numeric",
|
||||
'cod.qty'=>"Numeric",'cod.total_ht'=>"Numeric",'cod.total_tva'=>"Numeric",'cod.total_ttc'=>"Numeric",
|
||||
'cod.date_ouverture'=>"Date",'cod.date_ouverture_prevue'=>"Date",'cod.date_fin_validite'=>"Date",'cod.date_cloture'=>"Date",
|
||||
'p.rowid'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
|
||||
|
||||
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,';
|
||||
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'contrat as co,';
|
||||
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'contratdet as cod';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (cod.fk_product = p.rowid)';
|
||||
$this->export_sql_end[$r] .=' WHERE co.fk_soc = s.rowid and co.rowid = cod.fk_contrat';
|
||||
$this->export_sql_end[$r] .=' AND co.entity = '.$conf->entity;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -211,7 +211,7 @@ else {
|
||||
<?php } ?>
|
||||
<td align="right"><input type="text" size="2" name="qty" id="qty" class="flat" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>">
|
||||
</td>
|
||||
<td align="right" class="nowrap"><input type="text" size="1" name="remise_percent" id="remise_percent" class="flat" value="<?php echo (isset($_POST["remise_percent"])?$_POST["remise_percent"]:$buyer->remise_client); ?>"><span class="hideonsmartphone">%</span></td>
|
||||
<td align="right" class="nowrap"><input type="text" size="1" name="remise_percent" id="remise_percent" class="flat" value="<?php echo (isset($_POST["remise_percent"])?$_POST["remise_percent"]:$buyer->remise_percent); ?>"><span class="hideonsmartphone">%</span></td>
|
||||
|
||||
<?php
|
||||
if (! empty($usemargins))
|
||||
|
||||
@ -95,9 +95,18 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings');
|
||||
else setEventMessage($langs->trans("JobFinished"),'mesgs');
|
||||
$action='';
|
||||
$res = $object->reprogram_jobs($user->login);
|
||||
if ($res > 0)
|
||||
{
|
||||
if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings');
|
||||
else setEventMessage($langs->trans("JobFinished"),'mesgs');
|
||||
$action='';
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -100,6 +100,21 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->error,'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
$res = $object->reprogram_jobs($user->login);
|
||||
if ($res > 0)
|
||||
{
|
||||
if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings');
|
||||
else setEventMessage($langs->trans("JobFinished"),'mesgs');
|
||||
$action='';
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-1'); // Make a call to avoid to run twice job when using back
|
||||
exit;
|
||||
|
||||
@ -1453,7 +1453,6 @@ else if ($id || $ref)
|
||||
// Batch number managment
|
||||
if (! empty($conf->productbatch->enabled)) {
|
||||
if (isset($lines[$i]->detail_batch) ) {
|
||||
$flagBatch = true;
|
||||
print '<td align="center">';
|
||||
$detail = '';
|
||||
foreach ($lines[$i]->detail_batch as $dbatch) {
|
||||
@ -1543,14 +1542,7 @@ else if ($id || $ref)
|
||||
|
||||
if ($user->rights->expedition->supprimer)
|
||||
{
|
||||
if (empty($conf->productbatch->enabled) || (!empty($conf->productbatch->enabled) && !$conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !isset($flagBatch))
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
@ -588,10 +588,9 @@ class Expedition extends CommonObject
|
||||
$cpt = $this->db->num_rows($resql);
|
||||
for ($i = 0; $i < $cpt; $i++)
|
||||
{
|
||||
if($obj->qty <= 0) continue;
|
||||
|
||||
dol_syslog(get_class($this)."::valid movement index ".$i);
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if($obj->qty <= 0) continue;
|
||||
dol_syslog(get_class($this)."::valid movement index ".$i);
|
||||
|
||||
//var_dump($this->lines[$i]);
|
||||
$mouvS = new MouvementStock($this->db);
|
||||
|
||||
@ -57,7 +57,7 @@ $hookmanager->initHooks(array('suppliercard','globalcard'));
|
||||
*/
|
||||
|
||||
$parameters=array('socid'=>$socid);
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
if ($action == 'setsupplieraccountancycode')
|
||||
|
||||
@ -1970,7 +1970,8 @@ class CommandeFournisseur extends CommonOrder
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the translated input method
|
||||
* Returns the translated input method of object (defined if $this->methode_commande_id > 0).
|
||||
* This function make a sql request to get translation. No cache yet, try to not use it inside a loop.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@ -1980,21 +1981,19 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
if ($this->methode_commande_id > 0)
|
||||
{
|
||||
$sql = "SELECT rowid, code, libelle";
|
||||
$sql = "SELECT rowid, code, libelle as label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.'c_input_method';
|
||||
$sql.= " WHERE active=1 AND rowid = ".$db->escape($this->methode_commande_id);
|
||||
|
||||
$query = $db->query($sql);
|
||||
|
||||
if ($query && $db->num_rows($query))
|
||||
{
|
||||
$result = $db->fetch_object($query);
|
||||
$obj = $db->fetch_object($query);
|
||||
|
||||
$string = $langs->trans($result->code);
|
||||
|
||||
if ($string == $result->code)
|
||||
$string = $langs->trans($obj->code);
|
||||
if ($string == $obj->code)
|
||||
{
|
||||
$string = $obj->libelle != '-' ? $obj->libelle : '';
|
||||
$string = $obj->label != '-' ? $obj->label : '';
|
||||
}
|
||||
|
||||
return $string;
|
||||
|
||||
@ -149,6 +149,8 @@ UPDATE llx_actioncomm set fk_user_action = fk_user_done where fk_user_done > 0 a
|
||||
UPDATE llx_actioncomm set fk_user_action = fk_user_author where fk_user_author > 0 and (fk_user_action is null or fk_user_action = 0);
|
||||
|
||||
|
||||
UPDATE llx_projet_task_time set task_datehour = task_date where task_datehour IS NULL and task_date IS NOT NULL;
|
||||
|
||||
|
||||
-- Requests to clean old tables or external modules tables
|
||||
|
||||
|
||||
@ -266,6 +266,7 @@ Afternoon=Afternoon
|
||||
Quadri=Quadri
|
||||
MonthOfDay=Month of the day
|
||||
HourShort=H
|
||||
MinuteShort=mn
|
||||
Rate=Rate
|
||||
UseLocalTax=Include tax
|
||||
Bytes=Bytes
|
||||
@ -679,7 +680,7 @@ ViewPrivateNote=View notes
|
||||
XMoreLines=%s line(s) hidden
|
||||
PublicUrl=Public URL
|
||||
AddBox=Add box
|
||||
|
||||
SelectElementAndClickRefresh=Select an element and click Refresh
|
||||
# Week day
|
||||
Monday=Monday
|
||||
Tuesday=Tuesday
|
||||
|
||||
@ -1404,6 +1404,7 @@ class Product extends CommonObject
|
||||
$sql.= " weight, weight_units, length, length_units, surface, surface_units, volume, volume_units, barcode, fk_barcode_type, finished,";
|
||||
$sql.= " accountancy_code_buy, accountancy_code_sell, stock, pmp,";
|
||||
$sql.= " datec, tms, import_key, entity, desiredstock, tobatch";
|
||||
$sql.= " ,ref_ext";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product";
|
||||
if ($id) $sql.= " WHERE rowid = ".$this->db->escape($id);
|
||||
else
|
||||
@ -1478,6 +1479,8 @@ class Product extends CommonObject
|
||||
$this->date_modification = $obj->tms;
|
||||
$this->import_key = $obj->import_key;
|
||||
$this->entity = $obj->entity;
|
||||
|
||||
$this->ref_ext = $obj->ref_ext;
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
@ -2814,8 +2817,8 @@ class Product extends CommonObject
|
||||
if ($maxlength) $newref=dol_trunc($newref,$maxlength,'middle');
|
||||
|
||||
if ($withpicto) {
|
||||
if ($this->type == 0) $result.=($lien.img_object($langs->trans("ShowProduct").' '.$this->ref,'product').$lienfin.' ');
|
||||
if ($this->type == 1) $result.=($lien.img_object($langs->trans("ShowService").' '.$this->ref,'service').$lienfin.' ');
|
||||
if ($this->type == 0) $result.=($lien.img_object($langs->trans("ShowProduct").' '.$this->label,'product').$lienfin.' ');
|
||||
if ($this->type == 1) $result.=($lien.img_object($langs->trans("ShowService").' '.$this->label,'service').$lienfin.' ');
|
||||
}
|
||||
$result.=$lien.$newref.$lienfin;
|
||||
return $result;
|
||||
|
||||
@ -410,10 +410,14 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
||||
|
||||
// Prix mini
|
||||
print '<tr><td>' . $langs->trans("MinPrice") . ' ' . $i . '</td><td>';
|
||||
if ($object->multiprices_base_type ["$i"] == 'TTC') {
|
||||
if (empty($object->multiprices_base_type["$i"])) $object->multiprices_base_type["$i"]="HT";
|
||||
if ($object->multiprices_base_type["$i"] == 'TTC')
|
||||
{
|
||||
print price($object->multiprices_min_ttc["$i"]) . ' ' . $langs->trans($object->multiprices_base_type["$i"]);
|
||||
} else {
|
||||
print price($object->multiprices_min["$i"]) . ' ' . $langs->trans(empty($object->multiprices_base_type["$i"])?'HT':$object->multiprices_base_type["$i"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
print price($object->multiprices_min["$i"]) . ' ' . $langs->trans($object->multiprices_base_type["$i"]);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -83,6 +83,7 @@ if ($action == 'addtime' && $user->rights->projet->creer)
|
||||
foreach($timespent_duration as $key => $val)
|
||||
{
|
||||
$task->fetch($key);
|
||||
$task->progress = GETPOST($key . 'progress', 'int');
|
||||
$task->timespent_duration = $val;
|
||||
$task->timespent_fk_user = $user->id;
|
||||
$task->timespent_date = dol_mktime(12,0,0,$_POST["{$key}month"],$_POST["{$key}day"],$_POST["{$key}year"]);
|
||||
@ -178,7 +179,7 @@ print '<td>'.$langs->trans("LabelTask").'</td>';
|
||||
print '<td align="center">'.$langs->trans("DateStart").'</td>';
|
||||
print '<td align="center">'.$langs->trans("DateEnd").'</td>';
|
||||
print '<td align="right">'.$langs->trans("PlannedWorkload").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Progress").'</td>';
|
||||
print '<td align="right">'.$langs->trans("ProgressDeclared").'</td>';
|
||||
print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("AddDuration").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
@ -42,7 +42,7 @@ class Task extends CommonObject
|
||||
var $fk_task_parent;
|
||||
var $label;
|
||||
var $description;
|
||||
var $duration_effective;
|
||||
var $duration_effective; // total of time spent on this task
|
||||
var $planned_workload;
|
||||
var $date_c;
|
||||
var $date_start;
|
||||
@ -60,6 +60,7 @@ class Task extends CommonObject
|
||||
var $timespent_duration;
|
||||
var $timespent_old_duration;
|
||||
var $timespent_date;
|
||||
var $timespent_datehour; // More accurate start date (same than timespent_date but includes hours, minutes and seconds)
|
||||
var $timespent_fk_user;
|
||||
var $timespent_note;
|
||||
|
||||
@ -141,8 +142,9 @@ class Task extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
//Update extrafield
|
||||
if (!$error) {
|
||||
// Update extrafield
|
||||
if (! $error)
|
||||
{
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||
{
|
||||
$result=$this->insertExtraFields();
|
||||
@ -743,18 +745,21 @@ class Task extends CommonObject
|
||||
|
||||
// Clean parameters
|
||||
if (isset($this->timespent_note)) $this->timespent_note = trim($this->timespent_note);
|
||||
|
||||
if (empty($this->timespent_datehour)) $this->timespent_datehour = $this->timespent_date;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task_time (";
|
||||
$sql.= "fk_task";
|
||||
$sql.= ", task_date";
|
||||
$sql.= ", task_datehour";
|
||||
$sql.= ", task_duration";
|
||||
$sql.= ", fk_user";
|
||||
$sql.= ", note";
|
||||
$sql.= ") VALUES (";
|
||||
$sql.= $this->id;
|
||||
$sql.= ", '".$this->db->idate($this->timespent_date)."'";
|
||||
$sql.= ", '".$this->db->idate($this->timespent_datehour)."'";
|
||||
$sql.= ", ".$this->timespent_duration;
|
||||
$sql.= ", ".$this->timespent_fk_user;
|
||||
$sql.= ", ".(isset($this->timespent_note)?"'".$this->db->escape($this->timespent_note)."'":"null");
|
||||
@ -785,6 +790,7 @@ class Task extends CommonObject
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task";
|
||||
$sql.= " SET duration_effective = duration_effective + '".price2num($this->timespent_duration)."'";
|
||||
$sql.= ", progress = " . $this->progress;
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::addTimeSpent", LOG_DEBUG);
|
||||
@ -815,6 +821,47 @@ class Task extends CommonObject
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate total of time spent for task
|
||||
*
|
||||
* @param int $id Id of object (here task)
|
||||
* @return array Array of info for task array('min_date', 'max_date', 'total_duration')
|
||||
*/
|
||||
function getSummaryOfTimeSpent($id='')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
if (empty($id)) $id=$this->id;
|
||||
|
||||
$result=array();
|
||||
|
||||
$sql = "SELECT";
|
||||
$sql.= " MIN(t.task_datehour) as min_date,";
|
||||
$sql.= " MAX(t.task_datehour) as max_date,";
|
||||
$sql.= " SUM(t.task_duration) as total_duration";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task_time as t";
|
||||
$sql.= " WHERE t.fk_task = ".$id;
|
||||
|
||||
dol_syslog(get_class($this)."::getSummaryOfTimeSpent", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$result['min_date'] = $obj->min_date;
|
||||
$result['max_date'] = $obj->max_date;
|
||||
$result['total_duration'] = $obj->total_duration;
|
||||
|
||||
$this->db->free($resql);
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load object in memory from database
|
||||
*
|
||||
@ -876,12 +923,14 @@ class Task extends CommonObject
|
||||
$ret = 0;
|
||||
|
||||
// Clean parameters
|
||||
if (empty($this->timespent_datehour)) $this->timespent_datehour = $this->timespent_date;
|
||||
if (isset($this->timespent_note)) $this->timespent_note = trim($this->timespent_note);
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time SET";
|
||||
$sql.= " task_date = '".$this->db->idate($this->timespent_date)."',";
|
||||
$sql.= " task_datehour = '".$this->db->idate($this->timespent_datehour)."',";
|
||||
$sql.= " task_duration = ".$this->timespent_duration.",";
|
||||
$sql.= " fk_user = ".$this->timespent_fk_user.",";
|
||||
$sql.= " note = ".(isset($this->timespent_note)?"'".$this->db->escape($this->timespent_note)."'":"null");
|
||||
|
||||
@ -166,7 +166,7 @@ $sql.= " WHERE p.entity = ".$conf->entity;
|
||||
if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")";
|
||||
if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
|
||||
$sql.= " AND p.fk_statut=1";
|
||||
$sql.= " GROUP BY p.title, p.rowid, t.label, t.rowid, u.rowid, t.planned_workload, t.dateo, t.datee";
|
||||
$sql.= " GROUP BY p.ref, p.title, p.rowid, t.label, t.rowid, u.rowid, t.planned_workload, t.dateo, t.datee";
|
||||
$sql.= " ORDER BY u.rowid, t.dateo, t.datee";
|
||||
|
||||
$userstatic=new User($db);
|
||||
|
||||
@ -320,7 +320,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
||||
print '</td></tr>';
|
||||
|
||||
// Progress
|
||||
print '<tr><td>'.$langs->trans("Progress").'</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td colspan="3">';
|
||||
print $formother->select_percent($progress,'progress');
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -351,8 +351,8 @@ if ($id > 0 || ! empty($ref))
|
||||
print $form->select_duration('planned_workload',$object->planned_workload,0,'text');
|
||||
print '</td></tr>';
|
||||
|
||||
// Progress
|
||||
print '<tr><td>'.$langs->trans("Progress").'</td><td colspan="3">';
|
||||
// Progress declared
|
||||
print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td colspan="3">';
|
||||
print $formother->select_percent($object->progress,'progress');
|
||||
print '</td></tr>';
|
||||
|
||||
@ -383,7 +383,7 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
/*
|
||||
* Fiche tache en mode visu
|
||||
*/
|
||||
*/
|
||||
$param=($withproject?'&withproject=1':'');
|
||||
$linkback=$withproject?'<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>':'';
|
||||
|
||||
@ -440,14 +440,20 @@ if ($id > 0 || ! empty($ref))
|
||||
print convertSecondToTime($object->planned_workload,'allhourmin');
|
||||
print '</td></tr>';
|
||||
|
||||
// Progress
|
||||
// Progress declared
|
||||
print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td colspan="3">';
|
||||
print $object->progress.' %';
|
||||
print '</td></tr>';
|
||||
|
||||
// Progress
|
||||
// Progress calculated
|
||||
print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td colspan="3">';
|
||||
print $object->progress.' %';
|
||||
if ($object->planned_workload)
|
||||
{
|
||||
$tmparray=$object->getSummaryOfTimeSpent();
|
||||
if ($tmparray['total_duration'] > 0) print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %';
|
||||
else print '0 %';
|
||||
}
|
||||
else print '';
|
||||
print '</td></tr>';
|
||||
|
||||
// Description
|
||||
@ -504,7 +510,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
/*
|
||||
* Documents generes
|
||||
*/
|
||||
*/
|
||||
$filename=dol_sanitizeFileName($projectstatic->ref). "/". dol_sanitizeFileName($object->ref);
|
||||
$filedir=$conf->projet->dir_output . "/" . dol_sanitizeFileName($projectstatic->ref). "/" .dol_sanitizeFileName($object->ref);
|
||||
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
|
||||
$langs->load('projects');
|
||||
|
||||
@ -83,11 +84,11 @@ if ($action == 'addtimespent' && $user->rights->projet->creer)
|
||||
else
|
||||
{
|
||||
$object->timespent_note = $_POST["timespent_note"];
|
||||
$object->progress = GETPOST('progress', 'int');
|
||||
$object->timespent_duration = $_POST["timespent_durationhour"]*60*60; // We store duration in seconds
|
||||
$object->timespent_duration+= $_POST["timespent_durationmin"]*60; // We store duration in seconds
|
||||
$object->timespent_date = dol_mktime(12,0,0,$_POST["timemonth"],$_POST["timeday"],$_POST["timeyear"]);
|
||||
$object->timespent_fk_user = $_POST["userid"];
|
||||
|
||||
$result=$object->addTimeSpent($user);
|
||||
if ($result >= 0)
|
||||
{
|
||||
@ -180,18 +181,19 @@ if (! empty($project_ref) && ! empty($withproject))
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
*/
|
||||
|
||||
llxHeader("",$langs->trans("Task"));
|
||||
|
||||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
$userstatic = new User($db);
|
||||
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
/*
|
||||
* Fiche projet en mode visu
|
||||
*/
|
||||
*/
|
||||
if ($object->fetch($id) >= 0)
|
||||
{
|
||||
$result=$projectstatic->fetch($object->fk_project);
|
||||
@ -290,9 +292,37 @@ if ($id > 0 || ! empty($ref))
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$object->label.'</td></tr>';
|
||||
|
||||
// Planned workload
|
||||
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">'.convertSecondToTime($object->planned_workload,'allhourmin').'</td></tr>';
|
||||
|
||||
// Date start
|
||||
print '<tr><td>'.$langs->trans("DateStart").'</td><td colspan="3">';
|
||||
print dol_print_date($object->date_start,'dayhour');
|
||||
print '</td></tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr><td>'.$langs->trans("DateEnd").'</td><td colspan="3">';
|
||||
print dol_print_date($object->date_end,'dayhour');
|
||||
print '</td></tr>';
|
||||
|
||||
// Planned workload
|
||||
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">';
|
||||
print convertSecondToTime($object->planned_workload,'allhourmin');
|
||||
print '</td></tr>';
|
||||
|
||||
// Progress declared
|
||||
print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td colspan="3">';
|
||||
print $object->progress.' %';
|
||||
print '</td></tr>';
|
||||
|
||||
// Progress calculated
|
||||
print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td colspan="3">';
|
||||
if ($object->planned_workload)
|
||||
{
|
||||
$tmparray=$object->getSummaryOfTimeSpent();
|
||||
if ($tmparray['total_duration'] > 0) print round($tmparray['total_duration']/$object->planned_workload*100, 2).' %';
|
||||
else print '0 %';
|
||||
}
|
||||
else print '';
|
||||
print '</td></tr>';
|
||||
|
||||
// Project
|
||||
if (empty($withproject))
|
||||
{
|
||||
@ -307,6 +337,30 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Date start
|
||||
print '<tr><td>'.$langs->trans("DateStart").'</td><td colspan="3">';
|
||||
print dol_print_date($object->date_start,'dayhour');
|
||||
print '</td></tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr><td>'.$langs->trans("DateEnd").'</td><td colspan="3">';
|
||||
print dol_print_date($object->date_end,'dayhour');
|
||||
print '</td></tr>';
|
||||
|
||||
// Planned workload
|
||||
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">'.convertSecondToTime($object->planned_workload,'allhourmin').'</td></tr>';
|
||||
|
||||
// Declared progress
|
||||
print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td colspan="3">';
|
||||
print $object->progress.' %';
|
||||
print '</td></tr>';
|
||||
|
||||
// Calculated progress
|
||||
print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td colspan="3">';
|
||||
if ($object->planned_workload) print round(100 * $object->duration_effective / $object->planned_workload,2).' %';
|
||||
else print '';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
@ -314,7 +368,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
/*
|
||||
* Add time spent
|
||||
*/
|
||||
*/
|
||||
if ($user->rights->projet->creer)
|
||||
{
|
||||
print '<br>';
|
||||
@ -331,6 +385,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<td width="100">'.$langs->trans("Date").'</td>';
|
||||
print '<td>'.$langs->trans("By").'</td>';
|
||||
print '<td>'.$langs->trans("Note").'</td>';
|
||||
print '<td>'.$langs->trans("ProgressDeclared").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Duration").'</td>';
|
||||
print '<td width="80"> </td>';
|
||||
print "</tr>\n";
|
||||
@ -360,9 +415,14 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<textarea name="timespent_note" cols="80" rows="'.ROWS_3.'">'.($_POST['timespent_note']?$_POST['timespent_note']:'').'</textarea>';
|
||||
print '</td>';
|
||||
|
||||
// Progress declared
|
||||
print '<td class="nowrap">';
|
||||
print $formother->select_percent(GETPOST('progress')?GETPOST('progress'):$object->progress,'progress');
|
||||
print '</td>';
|
||||
|
||||
// Duration
|
||||
print '<td class="nowrap" align="right">';
|
||||
print $form->select_duration('timespent_duration',($_POST['timespent_duration']?$_POST['timespent_duration']:''),0,'text');
|
||||
print $form->select_duration('timespent_duration', ($_POST['timespent_duration']?$_POST['timespent_duration']:''), 0, 'text');
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
@ -376,7 +436,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
/*
|
||||
* List of time spent
|
||||
*/
|
||||
*/
|
||||
$sql = "SELECT t.rowid, t.task_date, t.task_duration, t.fk_user, t.note";
|
||||
$sql.= ", u.lastname, u.firstname";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t";
|
||||
|
||||
@ -2157,7 +2157,7 @@ else
|
||||
|
||||
if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC))
|
||||
{
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
/*
|
||||
@ -2172,7 +2172,7 @@ else
|
||||
|
||||
$somethingshown=$formfile->show_documents('company',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang);
|
||||
|
||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
print '</div></div></div>';
|
||||
|
||||
@ -62,6 +62,10 @@ if ($action == 'dolibarr2ldap')
|
||||
$result=$ldap->connect_bind();
|
||||
|
||||
$info=$fgroup->_load_ldap_info();
|
||||
// Get a gid number for objectclass PosixGroup
|
||||
if(in_array('posixGroup',$info['objectclass']))
|
||||
$info['gidNumber'] = $ldap->getNextGroupGid();
|
||||
|
||||
$dn=$fgroup->_load_ldap_dn($info);
|
||||
$olddn=$dn; // We can say that old dn = dn as we force synchro
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.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
|
||||
@ -27,8 +28,8 @@ define("NOLOGIN",1); // This means this output page does not require to be logge
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
|
||||
if (! empty($conf->ldap->enabled))
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
|
||||
|
||||
$langs->load("errors");
|
||||
$langs->load("users");
|
||||
@ -130,7 +131,8 @@ if ($action == 'buildnewpassword' && $username)
|
||||
// Success
|
||||
if ($edituser->send_password($user,$newpassword,1) > 0)
|
||||
{
|
||||
$message = '<div class="ok">'.$langs->trans("PasswordChangeRequestSent",$edituser->login,$edituser->email).'</div>';
|
||||
|
||||
$message = '<div class="ok">'.$langs->trans("PasswordChangeRequestSent",$edituser->login,dolObfuscateEmail($edituser->email)).'</div>';
|
||||
//$message.=$newpassword;
|
||||
$username='';
|
||||
}
|
||||
|
||||
@ -106,56 +106,41 @@ $server->wsdl->addComplexType(
|
||||
'tns:categorie'
|
||||
);
|
||||
|
||||
/*
|
||||
* Tableau des catégories
|
||||
|
||||
$server->wsdl->addComplexType(
|
||||
'categories',
|
||||
'complexType',
|
||||
'array',
|
||||
'',
|
||||
'SOAP-ENC:Array',
|
||||
array(),
|
||||
array(
|
||||
array('id'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:categorie[]')
|
||||
),
|
||||
'tns:categories'
|
||||
);
|
||||
/*
|
||||
* Image of product
|
||||
*/
|
||||
|
||||
/*
|
||||
* Les photos de la catégorie (un tableau indéxé qui contient les images avec leur vignette)
|
||||
$server->wsdl->addComplexType(
|
||||
'PhotosArray',
|
||||
'complexType',
|
||||
'array',
|
||||
'sequence',
|
||||
'',
|
||||
array(
|
||||
'image' => array(
|
||||
'name' => 'image',
|
||||
'type' => 'tns:image',
|
||||
'minOccurs' => '0',
|
||||
'maxOccurs' => 'unbounded'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
/*
|
||||
* An image
|
||||
*/
|
||||
$server->wsdl->addComplexType(
|
||||
'PhotosArray',
|
||||
'complexType',
|
||||
'array',
|
||||
'',
|
||||
'SOAP-ENC:Array',
|
||||
array(),
|
||||
array(
|
||||
array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:image[]')
|
||||
),
|
||||
''
|
||||
);
|
||||
|
||||
/*
|
||||
* Une photo ( nom image / nom_vignette )
|
||||
*/
|
||||
$server->wsdl->addComplexType(
|
||||
'image',
|
||||
'complexType',
|
||||
'array',
|
||||
'',
|
||||
'SOAP-ENC:Array',
|
||||
array(),
|
||||
array(
|
||||
'photo' => array('name'=>'photo','type'=>'xsd:string'),
|
||||
'photo_vignette' => array('name'=>'photo_vignette','type'=>'xsd:string'),
|
||||
'imgWidth' => array('name'=>'imgWidth','type'=>'xsd:string'),
|
||||
'imgHeight' => array('name'=>'imgHeight','type'=>'xsd:string')
|
||||
)
|
||||
);
|
||||
$server->wsdl->addComplexType(
|
||||
'image',
|
||||
'complexType',
|
||||
'struct',
|
||||
'all',
|
||||
'',
|
||||
array(
|
||||
'photo' => array('name'=>'photo','type'=>'xsd:string'),
|
||||
'photo_vignette' => array('name'=>'photo_vignette','type'=>'xsd:string'),
|
||||
'imgWidth' => array('name'=>'imgWidth','type'=>'xsd:string'),
|
||||
'imgHeight' => array('name'=>'imgHeight','type'=>'xsd:string')
|
||||
)
|
||||
);
|
||||
|
||||
/*
|
||||
* Retour
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2010-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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user