Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
mwelters committed Jan 19, 2019
2 parents de9b8f4 + 300889f commit 62ab67f
Show file tree
Hide file tree
Showing 82 changed files with 2,326 additions and 1,736 deletions.
15 changes: 7 additions & 8 deletions build/README
Expand Up @@ -16,18 +16,20 @@ Note: Prerequisites to build tgz, debian, rpm package
> apt-get install tar dpkg dpatch p7zip-full rpm zip

Note: Prerequisites to build autoexe DoliWamp package:
> apt-get install wine q4wine
> Launch "wine cmd" to check a drive Z: pointing to / exists.
> Install InnoSetup
For example by running isetup-5.3.9.exe (http://www.jrsoftware.org)
> Install WampServer into "C:\Program Files\Wamp"
For example by running wampserver2.2e-php5.4.3-httpd-2.4.2-mysql5.5.24-x64.exe (http://www.wampserver.com)
> Install WampServer addon to have versions: Apache2.2.11, Mysql5.0.45, Php5.3.0
For example by running WampServer2-APACHE2211.exe (http://www.wampserver.com)
For example by running wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe (http://www.wampserver.com)
> Install WampServer addon to have versions: Mysql5.0.45
For example by running WampServer2-MYSQL5045.exe (http://www.wampserver.com)
For example by running WampServer2-PHP530.exe (http://www.wampserver.com)
> To build from Windows (running from makepack-dolibarr.pl script is however
recommanded), open file build/exe/doliwamp.iss and click on button "Compile".
The .exe file will be build into directory build.

> Add path to ISCC into PATH windows var:
Launch wine cmd, then regedit and add entry int HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH

- To build a theme package, launch the script
> perl makepack-dolibarrtheme.pl

Expand All @@ -46,9 +48,6 @@ generated packages will not contains this "build" directory.

We can find in "build", following sub-directories:

* aps:
To build APS package.

* debian:
To build Debian package.

Expand Down
2 changes: 1 addition & 1 deletion build/exe/doliwamp/README
Expand Up @@ -5,4 +5,4 @@ DOLIWAMP Package tools

This directory contains files used by makepack-dolibarr.pl
script to build the all-in-on .EXE package DoliWamp, ready
to be distributedt (for Windows).
to be distributed (for Windows).
2 changes: 1 addition & 1 deletion build/exe/doliwamp/doliwamp.iss
Expand Up @@ -32,7 +32,7 @@ AppPublisherURL=https://www.nltechno.com
AppSupportURL=https://www.dolibarr.org
AppUpdatesURL=https://www.dolibarr.org
AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares.
AppCopyright=Copyright (C) 2008-2018 Laurent Destailleur (NLTechno), Fabian Rodriguez (Le Goût du Libre)
AppCopyright=Copyright (C) 2008-2019 Laurent Destailleur (NLTechno), Fabian Rodriguez (Le Goût du Libre)
DefaultDirName=c:\dolibarr
DefaultGroupName=Dolibarr
;LicenseFile=COPYING
Expand Down
2 changes: 1 addition & 1 deletion build/makepack-dolibarr.pl
Expand Up @@ -1058,7 +1058,7 @@
$ret=`cat "$SOURCE/build/exe/doliwamp/doliwamp.iss" | sed -e 's/__FILENAMEEXEDOLIWAMP__/$FILENAMEEXEDOLIWAMP/g' > "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`;

print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"\n";
$cmd= "ISCC.exe \"Z:$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"";
$cmd= "wine ISCC.exe \"Z:$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"";
print "$cmd\n";
$ret= `$cmd`;
#print "$ret\n";
Expand Down
6 changes: 5 additions & 1 deletion htdocs/accountancy/class/bookkeeping.class.php
Expand Up @@ -1418,6 +1418,7 @@ public function createFromClone($fromid)
dol_syslog(__METHOD__, LOG_DEBUG);

global $user;

$error = 0;
$object = new BookKeeping($this->db);

Expand All @@ -1432,6 +1433,7 @@ public function createFromClone($fromid)
// ...

// Create clone
$object->context['createfromclone'] = 'createfromclone';
$result = $object->create($user);

// Other options
Expand All @@ -1441,6 +1443,8 @@ public function createFromClone($fromid)
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
}

unset($object->context['createfromclone']);

// End
if (! $error) {
$this->db->commit();
Expand All @@ -1449,7 +1453,7 @@ public function createFromClone($fromid)
} else {
$this->db->rollback();

return - 1;
return -1;
}
}

Expand Down
18 changes: 15 additions & 3 deletions htdocs/adherents/class/subscription.class.php
Expand Up @@ -55,6 +55,7 @@ class Subscription extends CommonObject
/**
* @var int ID
*/
public $fk_type;
public $fk_adherent;

public $amount;
Expand Down Expand Up @@ -102,8 +103,17 @@ function create($user, $notrigger = false)

$this->db->begin();

$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, datec, dateadh, datef, subscription, note)";
$sql.= " VALUES (".$this->fk_adherent.", '".$this->db->idate($this->datec)."',";
$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note)";

if ($this->fk_type == null) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$member=new Adherent($this->db);
$result=$member->fetch($this->fk_adherent);
$type=$member->typeid;
} else {
$type=$this->fk_type;
}
$sql.= " VALUES (".$this->fk_adherent.", '".$type."', '".$this->db->idate($now)."',";
$sql.= " '".$this->db->idate($this->dateh)."',";
$sql.= " '".$this->db->idate($this->datef)."',";
$sql.= " ".$this->amount.",";
Expand Down Expand Up @@ -147,7 +157,7 @@ function create($user, $notrigger = false)
*/
function fetch($rowid)
{
$sql ="SELECT rowid, fk_adherent, datec,";
$sql ="SELECT rowid, fk_type, fk_adherent, datec,";
$sql.=" tms,";
$sql.=" dateadh as dateh,";
$sql.=" datef,";
Expand All @@ -166,6 +176,7 @@ function fetch($rowid)
$this->id = $obj->rowid;
$this->ref = $obj->rowid;

$this->fk_type = $obj->fk_type;
$this->fk_adherent = $obj->fk_adherent;
$this->datec = $this->db->jdate($obj->datec);
$this->datem = $this->db->jdate($obj->tms);
Expand Down Expand Up @@ -203,6 +214,7 @@ function update($user, $notrigger=0)
$this->db->begin();

$sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
$sql .= " fk_type = ".$this->fk_type.",";
$sql .= " fk_adherent = ".$this->fk_adherent.",";
$sql .= " note=".($this->note ? "'".$this->db->escape($this->note)."'" : 'null').",";
$sql .= " subscription = '".price2num($this->amount)."',";
Expand Down
21 changes: 21 additions & 0 deletions htdocs/adherents/subscription/card.php
Expand Up @@ -25,6 +25,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
if (! empty($conf->banque->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
Expand All @@ -34,6 +35,7 @@
$langs->loadLangs(array("companies","members","bills","users"));

$adh = new Adherent($db);
$adht = new AdherentType($db);
$object = new Subscription($db);
$errmsg='';

Expand Down Expand Up @@ -102,6 +104,7 @@
// Modifie valeures
$object->dateh=dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
$object->datef=dol_mktime($_POST['datesubendhour'], $_POST['datesubendmin'], 0, $_POST['datesubendmonth'], $_POST['datesubendday'], $_POST['datesubendyear']);
$object->fk_type=$_POST["typeid"];
$object->note=$_POST["note"];
$object->amount=$_POST["amount"];
//print 'datef='.$object->datef.' '.$_POST['datesubendday'];
Expand Down Expand Up @@ -202,6 +205,12 @@
print $form->showrefnav($object, 'rowid', $linkback, 1);
print '</td></tr>';

// Type
print '<tr>';
print '<td>'.$langs->trans("Type").'</td><td class="valeur" colspan="3">';
print $form->selectarray("typeid", $adht->liste_array(), (isset($_POST["typeid"])?$_POST["typeid"]:$object->fk_type));
print'</td></tr>';

// Member
$adh->ref=$adh->getFullName($langs);
print '<tr>';
Expand Down Expand Up @@ -299,6 +308,18 @@
print '<div class="underbanner clearboth"></div>';

print '<table class="border" width="100%">';

// Type
print '<tr>';
print '<td class="titlefield">'.$langs->trans("Type").'</td>';
print '<td class="valeur">';
if ( ! empty($object->fk_type) ) {
$adht->fetch($object->fk_type);
print $adht->getNomUrl(1);
} else {
print $langs->trans("NoType");
}
print '</td></tr>';

// Member
$adh->ref=$adh->getFullName($langs);
Expand Down
58 changes: 43 additions & 15 deletions htdocs/adherents/subscription/list.php
Expand Up @@ -25,6 +25,7 @@

require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';

Expand All @@ -38,6 +39,7 @@
$filter=GETPOST("filter","alpha");
$statut=(GETPOSTISSET("statut")?GETPOST("statut","alpha"):1);
$search_ref=GETPOST('search_ref','alpha');
$search_type=GETPOST('search_type','alpha');
$search_lastname=GETPOST('search_lastname','alpha');
$search_firstname=GETPOST('search_firstname','alpha');
$search_login=GETPOST('search_login','alpha');
Expand Down Expand Up @@ -74,10 +76,11 @@
);
$arrayfields=array(
'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
'd.fk_type'=>array('label'=>$langs->trans("Type"), 'checked'=>1),
'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
'd.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1),
'd.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1),
't.libelle'=>array('label'=>$langs->trans("Type"), 'checked'=>1),
't.libelle'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
'd.bank'=>array('label'=>$langs->trans("BankAccount"), 'checked'=>1, 'enabled'=>(! empty($conf->banque->enabled))),
/*'d.note_public'=>array('label'=>$langs->trans("NotePublic"), 'checked'=>0),
'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0),*/
Expand Down Expand Up @@ -112,16 +115,17 @@
// Purge search criteria
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$search="";
$search_ref="";
$search_lastname="";
$search_firstname="";
$search_login="";
$search_note="";
$search_amount="";
$search_account="";
$toselect='';
$search_array_options=array();
$search="";
$search_type="";
$search_ref="";
$search_lastname="";
$search_firstname="";
$search_login="";
$search_note="";
$search_amount="";
$search_account="";
$toselect='';
$search_array_options=array();
}
}

Expand All @@ -139,7 +143,7 @@

// List of subscriptions
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo,";
$sql.= " c.rowid as crowid, c.subscription,";
$sql.= " c.rowid as crowid, c.fk_type, c.subscription,";
$sql.= " c.dateadh, c.datef, c.datec as date_creation, c.tms as date_update,";
$sql.= " c.fk_bank as bank, c.note,";
$sql.= " b.fk_account";
Expand All @@ -157,6 +161,7 @@
if (is_numeric($search_ref)) $sql.= " AND (c.rowid = ".$db->escape($search_ref).")";
else $sql.=" AND 1 = 2"; // Always wrong
}
if ($search_type) $sql.= natural_search(array('c.fk_type'), $search_type);
if ($search_lastname) $sql.= natural_search(array('d.lastname','d.societe'), $search_lastname);
if ($search_firstname) $sql.= natural_search(array('d.firstname'), $search_firstname);
if ($search_login) $sql.= natural_search('d.login', $search_login);
Expand Down Expand Up @@ -220,6 +225,7 @@
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($statut != '') $param.="&statut=".urlencode($statut);
if ($search_type) $param.="&search_type=".urlencode($search_type);
if ($date_select) $param.="&date_select=".urlencode($date_select);
if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname);
if ($search_login) $param.="&search_login=".urlencode($search_login);
Expand Down Expand Up @@ -297,6 +303,14 @@
print '<input class="flat" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'" size="4"></td>';
}

// Type
if (! empty($arrayfields['d.fk_type']['checked']))
{
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_type" value="'.dol_escape_htmltag($search_type).'" size="7">';
print'</td>';
}

if (! empty($arrayfields['d.lastname']['checked']))
{
print '<td class="liste_titre" align="left">';
Expand Down Expand Up @@ -379,6 +393,10 @@
{
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"c.rowid",$param,"","",$sortfield,$sortorder);
}
if (! empty($arrayfields['d.fk_type']['checked']))
{
print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"c.fk_type",$param,"","",$sortfield,$sortorder);
}
if (! empty($arrayfields['d.lastname']['checked']))
{
print_liste_field_titre("LastName",$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
Expand Down Expand Up @@ -441,7 +459,9 @@
$adherent->statut=$obj->statut;
$adherent->login=$obj->login;
$adherent->photo=$obj->photo;


$adht = new AdherentType($db);
$adht->fetch($obj->fk_type);

print '<tr class="oddeven">';

Expand All @@ -451,6 +471,14 @@
print '<td>'.$subscription->getNomUrl(1).'</td>';
if (! $i) $totalarray['nbfield']++;
}
// Type
if (! empty($arrayfields['d.fk_type']['checked']))
{
print '<td>';
if ( ! empty($obj->fk_type) ) print $adht->getNomUrl(1);
print '</td>';
if (! $i) $totalarray['nbfield']++;
}

// Lastname
if (! empty($arrayfields['d.lastname']['checked']))
Expand Down Expand Up @@ -568,8 +596,8 @@
{
if ($i == 1)
{
if ($num < $limit) print '<td class="left">'.$langs->trans("Total").'</td>';
else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>';
if ($num < $limit) print '<td align="left">'.$langs->trans("Total").'</td>';
else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
}
else print '<td></td>';
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/dolistore/class/dolistore.class.php
Expand Up @@ -65,7 +65,7 @@ function __construct($debug=false)

$langtmp = explode('_', $langs->defaultlang);
$lang = $langtmp[0];
$lang_array = array('en'=>1, 'fr'=>2, 'es'=>3, 'it'=>4, 'de'=>5); // Into table ps_lang of Prestashop - 1
$lang_array = array('en'=>0, 'fr'=>1, 'es'=>2, 'it'=>3, 'de'=>4); // Into table ps_lang of Prestashop - 1
if (! in_array($lang, array_keys($lang_array))) $lang = 'en';
$this->lang = $lang_array[$lang];
}
Expand Down
2 changes: 2 additions & 0 deletions htdocs/asset/class/asset.class.php
Expand Up @@ -238,6 +238,8 @@ public function createFromClone(User $user, $fromid)
$this->errors = $object->errors;
}

unset($object->context['createfromclone']);

// End
if (!$error) {
$this->db->commit();
Expand Down
3 changes: 1 addition & 2 deletions htdocs/cashdesk/class/Facturation.class.php
Expand Up @@ -215,8 +215,7 @@ public function calculTotaux()
$total_localtax1 = 0;
$total_localtax2 = 0;

$tab=array();
$tab = $_SESSION['poscart'];
$tab = (! empty($_SESSION['poscart'])?$_SESSION['poscart']:array());

$tab_size=count($tab);
for($i=0;$i < $tab_size;$i++)
Expand Down

0 comments on commit 62ab67f

Please sign in to comment.