Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
atm-maxime committed Nov 21, 2013
2 parents 45b7d5e + f6f4f42 commit aec0f01
Show file tree
Hide file tree
Showing 14 changed files with 95 additions and 54 deletions.
10 changes: 9 additions & 1 deletion build/makepack-dolibarr.pl
Expand Up @@ -2,7 +2,15 @@
#----------------------------------------------------------------------------
# \file build/makepack-dolibarr.pl
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
# \author (c)2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
# \author (c)2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
#
# This is list of constant you can set to have generated packages moved into a specific dir:
#DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'
#DESTISTABLE='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/stable'
#DESTIMODULES='/media/HDDATA1_LD/Mes Sites/Web/Admin1/wwwroot/files/modules'
#DESTIDOLIMEDBETARC='/media/HDDATA1_LD/Mes Sites/Web/DoliCloud/dolimed.com/htdocs/files/lastbuild'
#DESTIDOLIMEDMODULES='/media/HDDATA1_LD/Mes Sites/Web/DoliCloud/dolimed.com/htdocs/files/modules'
#DESTIDOLIMEDSTABLE='/media/HDDATA1_LD/Mes Sites/Web/DoliCloud/dolimed.com/htdocs/files/stable'
#----------------------------------------------------------------------------

use Cwd;
Expand Down
8 changes: 5 additions & 3 deletions build/makepack-dolibarrmodule.pl
Expand Up @@ -2,13 +2,15 @@
#----------------------------------------------------------------------------
# \file build/makepack-dolibarrmodule.pl
# \brief Package builder (tgz, zip, rpm, deb, exe)
# \author (c)2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
# \author (c)2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
#----------------------------------------------------------------------------

use Cwd;
$OWNER="ldestailleur";
$GROUP="ldestailleur";


@LISTETARGET=("TGZ"); # Possible packages
@LISTETARGET=("ZIP"); # Possible packages
%REQUIREMENTTARGET=( # Tool requirement for each package
"TGZ"=>"tar",
"ZIP"=>"7z"
Expand Down Expand Up @@ -272,7 +274,6 @@
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom2`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/bureau2crea`;
$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 -fr $BUILDROOT/$PROJECT/CVS* $BUILDROOT/$PROJECT/*/CVS* $BUILDROOT/$PROJECT/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/CVS*`;
Expand Down Expand Up @@ -323,6 +324,7 @@

print "Move $FILENAMEZIP.zip to $NEWDESTI/$FILENAMEZIP.zip\n";
$ret=`mv "$BUILDROOT/$FILENAMEZIP.zip" "$NEWDESTI/$FILENAMEZIP.zip"`;
$ret=`chown $OWNER.$GROUP "$NEWDESTI/$FILENAMEZIP.zip"`;
next;
}

Expand Down
9 changes: 9 additions & 0 deletions build/obs/README
Expand Up @@ -34,3 +34,12 @@ Enter the Remote URL that should looks like this: http://www.dolibarr.org/files/
Then add into advanded - attributes
OBS:Screenshots http://www.dolibarr.org/images/dolibarr_screenshot1.png
OBS:QualityCategory Testing


# Move project into official directory
- Enter a bug to ask to be a maintener of a category or to add a new one.
For example: https://bugzilla.novell.com/show_bug.cgi?id=848083 to be a maintener of category
https://build.opensuse.org/project/show/Application:ERP
- Once done, go into project, category, subproject and enter a subproject for your application.
Fo example: Dolibarr
- Then go onto project into your home and ask a publish to the category/you project your created.
6 changes: 3 additions & 3 deletions htdocs/compta/facture.php
Expand Up @@ -3859,21 +3859,21 @@
{
/*
* Affiche formulaire mail
*/
*/

// By default if $action=='presend'
$titreform='SendBillByMail';
$topicmail='SendBillRef';
$action='send';
$modelmail='facture_send';

if ($action == 'prerelance') // For backward compatibility
{
$titrefrom='SendReminderBillByMail';
$topicmail='SendReminderBillRef';
$action='relance';
$modelmail='facture_relance';
$action='relance';
}
else $action='send';

$ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
Expand Down
1 change: 1 addition & 0 deletions htdocs/contact/class/contact.class.php
Expand Up @@ -124,6 +124,7 @@ function create($user)
if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords($this->firstname);
if (! $this->socid) $this->socid = 0;
if (! $this->priv) $this->priv = 0;
if (empty($this->statut)) $this->statut = 0;

$sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (";
$sql.= " datec";
Expand Down
4 changes: 4 additions & 0 deletions htdocs/core/class/extrafields.class.php
Expand Up @@ -935,6 +935,10 @@ function showOutputField($key,$value,$moreparam='')

$sql = 'SELECT '.$keyList;
$sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0];
if (strpos($InfoFieldList[4], 'extra')!==false)
{
$sql.= ' as main';
}
$sql.= ' WHERE '.$selectkey.'=\''.$this->db->escape($value).'\'';
//$sql.= ' AND entity = '.$conf->entity;
dol_syslog(get_class($this).':showOutputField:$type=sellist sql='.$sql);
Expand Down
Expand Up @@ -529,7 +529,6 @@ function write_file($object,$outputlangs,$srctemplatepath)
else // Text
{
$odfHandler->setVars($key, $value, true, 'UTF-8');
$odfHandler->setVarsHeadFooter($key, $value, true, 'UTF-8');
}
}
catch(OdfException $e)
Expand Down Expand Up @@ -1037,4 +1036,4 @@ function write_file($object,$outputlangs,$srctemplatepath)
}

}
?>
?>
2 changes: 2 additions & 0 deletions htdocs/fourn/facture/paiement.php
Expand Up @@ -59,6 +59,8 @@
}


// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('paymentsupplier'));


/*
Expand Down
27 changes: 0 additions & 27 deletions htdocs/includes/odtphp/odf.php
Expand Up @@ -128,33 +128,6 @@ public function setVars($key, $value, $encode = true, $charset = 'ISO-8859')
return $this;
}

/**
* Assing a template variable
*
* @param string $key name of the variable within the template
* @param string $value replacement value
* @param bool $encode if true, special XML characters are encoded
* @throws OdfException
* @return odf
*/
public function setVarsHeadFooter($key, $value, $encode = true, $charset = 'ISO-8859')
{
$tag = $this->config['DELIMITER_LEFT'] . $key . $this->config['DELIMITER_RIGHT'];
// TODO Warning string may be:
// <text:span text:style-name="T13">{</text:span><text:span text:style-name="T12">aaa</text:span><text:span text:style-name="T13">}</text:span>
// instead of {aaa} so we should enhance this function.
//print $key.'-'.$value.'-'.strpos($this->contentXml, $this->config['DELIMITER_LEFT'] . $key . $this->config['DELIMITER_RIGHT']).'<br>';
if (strpos($this->stylesXml, $tag) === false && strpos($this->stylesXml , $tag) === false) {
//if (strpos($this->contentXml, '">'. $key . '</text;span>') === false) {
throw new OdfException("var $key not found in the document");
//}
}
$value = $encode ? htmlspecialchars($value) : $value;
$value = ($charset == 'ISO-8859') ? utf8_encode($value) : $value;
$this->vars[$tag] = str_replace("\n", "<text:line-break/>", $value);
return $this;
}

/**
* Evaluating php codes inside the ODT and output the buffer (print, echo) inplace of the code
*
Expand Down
4 changes: 2 additions & 2 deletions htdocs/product/fiche.php
Expand Up @@ -698,7 +698,7 @@
$tmpcode='';
if (! empty($modCodeProduct->code_auto))
$tmpcode=$modCodeProduct->getNextValue($object,$type);
print '<td class="fieldrequired" width="20%">'.$langs->trans("Ref").'</td><td><input name="ref" size="40" maxlength="32" value="'.dol_escape_htmltag(GETPOST('ref')?GETPOST('ref'):$tmpcode).'">';
print '<td class="fieldrequired" width="20%">'.$langs->trans("Ref").'</td><td><input name="ref" size="40" maxlength="128" value="'.dol_escape_htmltag(GETPOST('ref')?GETPOST('ref'):$tmpcode).'">';
if ($_error)
{
print $langs->trans("RefAlreadyExists");
Expand Down Expand Up @@ -881,7 +881,7 @@
print '<table class="border allwidth">';

// Ref
print '<tr><td width="15%" class="fieldrequired">'.$langs->trans("Ref").'</td><td colspan="2"><input name="ref" size="40" maxlength="32" value="'.$object->ref.'"></td></tr>';
print '<tr><td width="15%" class="fieldrequired">'.$langs->trans("Ref").'</td><td colspan="2"><input name="ref" size="40" maxlength="128" value="'.$object->ref.'"></td></tr>';

// Label
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td colspan="2"><input name="libelle" size="40" maxlength="255" value="'.$object->libelle.'"></td></tr>';
Expand Down
24 changes: 16 additions & 8 deletions htdocs/product/liste.php
Expand Up @@ -7,6 +7,7 @@
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* 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
Expand Down Expand Up @@ -175,8 +176,8 @@
}
$sql .= natural_search($params, $snom);
}
if (isset($tosell) && dol_strlen($tosell) > 0) $sql.= " AND p.tosell = ".$db->escape($tosell);
if (isset($tobuy) && dol_strlen($tobuy) > 0) $sql.= " AND p.tobuy = ".$db->escape($tobuy);
if (isset($tosell) && dol_strlen($tosell) > 0 && $tosell!=-1) $sql.= " AND p.tosell = ".$db->escape($tosell);
if (isset($tobuy) && dol_strlen($tobuy) > 0 && $tobuy!=-1) $sql.= " AND p.tobuy = ".$db->escape($tobuy);
if (dol_strlen($canvas) > 0) $sql.= " AND p.canvas = '".$db->escape($canvas)."'";
if ($catid > 0) $sql.= " AND cp.fk_categorie = ".$catid;
if ($catid == -2) $sql.= " AND cp.fk_categorie IS NULL";
Expand Down Expand Up @@ -297,8 +298,9 @@
}
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) print '<td class="liste_titre" align="right">'.$langs->trans("DesiredStock").'</td>';
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) print '<td class="liste_titre" align="right">'.$langs->trans("PhysicalStock").'</td>';
print_liste_field_titre($langs->trans("Sell"), $_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Buy"), $_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Sell"), $_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Buy"), $_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="center"',$sortfield,$sortorder);
print '<td width="1%">&nbsp;</td>';
print "</tr>\n";

// Lignes des champs de filtre
Expand Down Expand Up @@ -354,8 +356,12 @@
print '</td>';
}

print '<td class="liste_titre">';
print '&nbsp;';
print '<td align="center">';
print $form->selectarray('tosell', array('0'=>$langs->trans('ProductStatusNotOnSellShort'),'1'=>$langs->trans('ProductStatusOnSellShort')),$tosell,1);
print '</td >';

print '<td align="center">';
print $form->selectarray('tobuy', array('0'=>$langs->trans('ProductStatusNotOnBuyShort'),'1'=>$langs->trans('ProductStatusOnBuyShort')),$tobuy,1);
print '</td>';

print '<td class="liste_titre" align="right">';
Expand Down Expand Up @@ -475,11 +481,13 @@
}

// Status (to buy)
print '<td align="right" class="nowrap">'.$product_static->LibStatut($objp->tosell,5,0).'</td>';
print '<td align="center" class="nowrap">'.$product_static->LibStatut($objp->tosell,5,0).'</td>';

// Status (to sell)
print '<td align="right" class="nowrap">'.$product_static->LibStatut($objp->tobuy,5,1).'</td>';
print '<td align="center" class="nowrap">'.$product_static->LibStatut($objp->tobuy,5,1).'</td>';

print '<td>&nbsp;</td>';

print "</tr>\n";
$i++;
}
Expand Down
7 changes: 5 additions & 2 deletions htdocs/product/stock/fiche.php
Expand Up @@ -268,8 +268,11 @@

// Country
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
$img=picto_from_langcode($object->country_code);
print ($img?$img.' ':'');
if (! empty($object->country_code))
{
$img=picto_from_langcode($object->country_code);
print ($img?$img.' ':'');
}
print $object->country;
print '</td></tr>';

Expand Down
30 changes: 28 additions & 2 deletions htdocs/user/index.php
Expand Up @@ -41,6 +41,8 @@

$sall=GETPOST('sall','alpha');
$search_user=GETPOST('search_user','alpha');
$search_statut=GETPOST('search_statut','alpha');
if ($search_statut=='') $search_statut=1; // always display activ customer first

$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
Expand All @@ -55,6 +57,7 @@

$userstatic=new User($db);
$companystatic = new Societe($db);
$form = new Form($db);


/*
Expand Down Expand Up @@ -86,6 +89,10 @@
{
$sql.= " AND (u.login LIKE '%".$db->escape($search_user)."%' OR u.lastname LIKE '%".$db->escape($search_user)."%' OR u.firstname LIKE '%".$db->escape($search_user)."%')";
}
if ($search_statut!='')
{
$sql.= " AND (u.statut=".$search_statut.")";
}
if ($sall) $sql.= " AND (u.login LIKE '%".$db->escape($sall)."%' OR u.lastname LIKE '%".$db->escape($sall)."%' OR u.firstname LIKE '%".$db->escape($sall)."%' OR u.email LIKE '%".$db->escape($sall)."%' OR u.note LIKE '%".$db->escape($sall)."%')";
$sql.=$db->order($sortfield,$sortorder);

Expand All @@ -95,6 +102,8 @@
$num = $db->num_rows($result);
$i = 0;

print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";

$param="search_user=$search_user&amp;sall=$sall";
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
Expand All @@ -104,7 +113,22 @@
print_liste_field_titre($langs->trans("Company"),"index.php","u.fk_societe",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateCreation"),"index.php","u.datec",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("LastConnexion"),"index.php","u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),"index.php","u.statut",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),"index.php","u.statut",$param,"",'align="center"',$sortfield,$sortorder);
print '<td width="1%">&nbsp;</td>';
print "</tr>\n";

//SearchBar
print '<tr class="liste_titre">';
print '<td colspan="6">&nbsp;</td>';

print '<td>';
print $form->selectarray('search_statut', array('0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut);
print '</td>';

print '<td class="liste_titre" align="right">';
print '<input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '</td>';

print "</tr>\n";
$var=True;
while ($i < $num)
Expand Down Expand Up @@ -168,11 +192,13 @@

// Statut
$userstatic->statut=$obj->statut;
print '<td width="100" align="right">'.$userstatic->getLibStatut(5).'</td>';
print '<td width="100" align="center">'.$userstatic->getLibStatut(5).'</td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
$i++;
}
print "</table>";
print "</form>\n";
$db->free($result);
}
else
Expand Down
14 changes: 10 additions & 4 deletions htdocs/webservices/server_contact.php
Expand Up @@ -113,7 +113,8 @@
'user_id' => array('name'=>'user_id','type'=>'xsd:string'),
'user_login' => array('name'=>'user_login','type'=>'xsd:string'),
'civility_id' => array('name'=>'civility_id','type'=>'xsd:string'),
'poste' => array('name'=>'poste','type'=>'xsd:string')
'poste' => array('name'=>'poste','type'=>'xsd:string'),
'statut' => array('name'=>'statut','type'=>'xsd:string')
//...
);
//Retreive all extrafield for contact
Expand Down Expand Up @@ -302,7 +303,8 @@ function getContact($authentication,$id,$ref='',$ref_ext='')
'user_id' => $contact->user_id,
'user_login' => $contact->user_login,
'civilite_id' => $contact->civility_id,
'poste' => $contact->poste
'poste' => $contact->poste,
'statut' => $contact->statut
);

//Retreive all extrafield for thirdsparty
Expand Down Expand Up @@ -412,6 +414,7 @@ function createContact($authentication,$contact)
$newobject->user_id=$contact['user_id'];
$newobject->user_login=$contact['user_login'];
$newobject->poste=$contact['poste'];
$newobject->statut=$contact['statut'];

//Retreive all extrafield for thirdsparty
// fetch optionals attributes and labels
Expand Down Expand Up @@ -488,7 +491,7 @@ function getContactsForThirdParty($authentication,$idthirdparty)
{
$linesinvoice=array();

$sql = "SELECT c.rowid, c.fk_soc, c.civilite as civility_id, c.lastname, c.firstname,";
$sql = "SELECT c.rowid, c.fk_soc, c.civilite as civility_id, c.lastname, c.firstname, c.statut,";
$sql.= " c.address, c.zip, c.town,";
$sql.= " c.fk_pays as country_id,";
$sql.= " c.fk_departement,";
Expand Down Expand Up @@ -565,7 +568,8 @@ function getContactsForThirdParty($authentication,$idthirdparty)
'ref_commande' => $contact->ref_commande?$contact->ref_commande:'',
'ref_propal' => $contact->ref_propal?$contact->ref_propal:'',
'user_id' => $contact->user_id?$contact->user_id:'',
'user_login' => $contact->no_email?$contact->user_login:''
'user_login' => $contact->user_login?$contact->user_login:'',
'statut' => $contact->statut?$contact->statut:''



Expand Down Expand Up @@ -659,6 +663,8 @@ function updateContact($authentication,$contact)
$object->civilite_id=$contact['civility_id'];
$object->poste=$contact['poste'];

$object->statut=$contact['statut'];


//Retreive all extrafield for contact
// fetch optionals attributes and labels
Expand Down

0 comments on commit aec0f01

Please sign in to comment.