Skip to content

Commit

Permalink
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into d…
Browse files Browse the repository at this point in the history
…evelop6
  • Loading branch information
eldy committed Dec 18, 2016
2 parents 902169c + 60b8582 commit 78bf209
Show file tree
Hide file tree
Showing 80 changed files with 1,460 additions and 1,094 deletions.
8 changes: 7 additions & 1 deletion build/debian/conf.php.install
Expand Up @@ -221,7 +221,13 @@ $dolibarr_main_prod='0';
# $dolibarr_main_limit_users='0';

# dolibarr_mailing_limit_sendbyweb
# Can set a limit for mailing send by web, can be used for a restricted mode.
# Can set a limit for mailing send by web. This overwrite database value. Can be used to restrict on OS level.
# Default value: 0 (use database value if exist)
# Examples:
# $dolibarr_mailing_limit_sendbyweb='0';

# dolibarr_mailing_limit_sendbycli
# Can set a limit for mailing send by cli. This overwrite database value. Can be used to restrict on OS level.
# Default value: 0 (use database value if exist)
# Examples:
# $dolibarr_mailing_limit_sendbycli='0';
32 changes: 16 additions & 16 deletions htdocs/adherents/card.php
Expand Up @@ -822,7 +822,7 @@ function initfieldrequired()
// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="member_login" size="40" value="'.(isset($_POST["member_login"])?$_POST["member_login"]:$object->login).'"></td></tr>';
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="member_login" class="maxwidth200" value="'.(isset($_POST["member_login"])?GETPOST("member_login", 'alpha', 2):$object->login).'"></td></tr>';
}

// Type
Expand Down Expand Up @@ -1066,7 +1066,7 @@ function initfieldrequired()
// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td colspan="2"><input type="text" name="login" size="30" value="'.(isset($_POST["login"])?$_POST["login"]:$object->login).'"></td></tr>';
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td colspan="2"><input type="text" name="login" class="maxwidth200" value="'.(isset($_POST["login"])?GETPOST("login",'alpha',2):$object->login).'"></td></tr>';
}

// Morphy
Expand All @@ -1090,7 +1090,7 @@ function initfieldrequired()
print "</td></tr>";

// Company
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.(isset($_POST["societe"])?$_POST["societe"]:$object->societe).'"></td></tr>';
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.(isset($_POST["societe"])?GETPOST("societe",'',2):$object->societe).'"></td></tr>';

// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
Expand All @@ -1099,11 +1099,11 @@ function initfieldrequired()
print '</tr>';

// Lastname
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" size="40" value="'.(isset($_POST["lastname"])?$_POST["lastname"]:$object->lastname).'"></td>';
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" size="40" value="'.(isset($_POST["lastname"])?GETPOST("lastname",'',2):$object->lastname).'"></td>';
print '</tr>';

// Firstname
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(isset($_POST["firstname"])?$_POST["firstname"]:$object->firstname).'"></td>';
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(isset($_POST["firstname"])?GETPOST("firstname",'',3):$object->firstname).'"></td>';
print '</tr>';

// Photo
Expand All @@ -1122,24 +1122,24 @@ function initfieldrequired()
print '</td></tr>';

// EMail
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="email" size="40" value="'.(isset($_POST["email"])?$_POST["email"]:$object->email).'"></td></tr>';
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="email" size="40" value="'.(isset($_POST["email"])?GETPOST("email",'',2):$object->email).'"></td></tr>';

// Password
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" size="30" value="'.(isset($_POST["pass"])?$_POST["pass"]:$object->pass).'"></td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" class="maxwdith200" value="'.(isset($_POST["pass"])?GETPOST("pass",'',2):$object->pass).'"></td></tr>';
}

// Address
print '<tr><td>'.$langs->trans("Address").'</td><td>';
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(isset($_POST["address"])?$_POST["address"]:$object->address).'</textarea>';
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(isset($_POST["address"])?GETPOST("address",'',2):$object->address).'</textarea>';
print '</td></tr>';

// Zip / Town
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
print $formcompany->select_ziptown((isset($_POST["zipcode"])?GETPOST("zipcode",'',2):$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
print ' ';
print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id'));
print $formcompany->select_ziptown((isset($_POST["town"])?GETPOST("town",'',2):$object->town),'town',array('zipcode','selectcountry_id','state_id'));
print '</td></tr>';

// Country
Expand All @@ -1153,23 +1153,23 @@ function initfieldrequired()
if (empty($conf->global->MEMBER_DISABLE_STATE))
{
print '<tr><td>'.$langs->trans('State').'</td><td>';
print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id);
print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id);
print '</td></tr>';
}

// Pro phone
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(isset($_POST["phone"])?$_POST["phone"]:$object->phone).'"></td></tr>';
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input type="text" name="phone" size="20" value="'.(isset($_POST["phone"])?GETPOST("phone"):$object->phone).'"></td></tr>';

// Personal phone
print '<tr><td>'.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(isset($_POST["phone_perso"])?$_POST["phone_perso"]:$object->phone_perso).'"></td></tr>';
print '<tr><td>'.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(isset($_POST["phone_perso"])?GETPOST("phone_perso"):$object->phone_perso).'"></td></tr>';

// Mobile phone
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td></tr>';
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?GETPOST("hone_mobile"):$object->phone_mobile).'"></td></tr>';

// Skype
if (! empty($conf->skype->enabled))
{
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="skype" size="40" value="'.(isset($_POST["skype"])?$_POST["skype"]:$object->skype).'"></td></tr>';
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="skype" size="40" value="'.(isset($_POST["skype"])?GETPOST("skype"):$object->skype).'"></td></tr>';
}

// Birthday
Expand All @@ -1179,7 +1179,7 @@ function initfieldrequired()

// Public profil
print "<tr><td>".$langs->trans("Public")."</td><td>\n";
print $form->selectyesno("public",(isset($_POST["public"])?$_POST["public"]:$object->public),1);
print $form->selectyesno("public",(isset($_POST["public"])?GETPOST("public",'',2):$object->public),1);
print "</td></tr>\n";

// Categories
Expand Down
28 changes: 27 additions & 1 deletion htdocs/adherents/class/subscription.class.php
Expand Up @@ -32,7 +32,8 @@ class Subscription extends CommonObject
{
public $element='subscription';
public $table_element='subscription';

public $picto='payment';

var $datec; // Date creation
var $datem; // Date modification
var $dateh; // Subscription start date (date subscription)
Expand Down Expand Up @@ -277,6 +278,31 @@ function getNomUrl($withpicto=0)
}


/**
* Retourne le libelle du statut d'une adhesion
*
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label
*/
function getLibStatut($mode=0)
{
return '';
}

/**
* Renvoi le libelle d'un statut donne
*
* @param int $statut Id statut
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label
*/
function LibStatut($statut)
{
global $langs;
$langs->load("members");
return '';
}

/**
* Load information of the subscription object
*
Expand Down
8 changes: 6 additions & 2 deletions htdocs/adherents/subscription.php
Expand Up @@ -792,7 +792,7 @@
$sql.= " c.datef,";
$sql.= " c.fk_bank,";
$sql.= " b.rowid as bid,";
$sql.= " ba.rowid as baid, ba.label, ba.bank";
$sql.= " ba.rowid as baid, ba.label, ba.bank, ba.ref, ba.account_number, ba.accountancy_journal, ba.number";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank = b.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
Expand All @@ -807,7 +807,7 @@
$num = $db->num_rows($result);
$i = 0;

print "<table class=\"noborder\" width=\"100%\">\n";
print '<table class="noborder" width="100%">'."\n";

print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Ref").'</td>';
Expand Down Expand Up @@ -841,6 +841,10 @@
{
$accountstatic->label=$objp->label;
$accountstatic->id=$objp->baid;
$accountstatic->number=$objp->number;
$accountstatic->account_number=$objp->account_number;
$accountstatic->accountancy_journal=$objp->accountancy_journal;
$accountstatic->ref=$objp->ref;
print $accountstatic->getNomUrl(1);
}
else
Expand Down
44 changes: 24 additions & 20 deletions htdocs/adherents/subscription/card.php
Expand Up @@ -40,6 +40,7 @@
$rowid=GETPOST("rowid","int")?GETPOST("rowid","int"):GETPOST("id","int");
$typeid=GETPOST("typeid","int");
$cancel=GETPOST('cancel');
$confirm=GETPOST('confirm');

if (! $user->rights->adherent->cotisation->lire)
accessforbidden();
Expand All @@ -62,10 +63,10 @@
//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once


if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update' && ! $_POST["cancel"])
if ($user->rights->adherent->cotisation->creer && $action == 'update' && ! $cancel)
{
// Charge objet actuel
$result=$object->fetch($_POST["rowid"]);
$result=$object->fetch($rowid);
if ($result > 0)
{
$db->begin();
Expand Down Expand Up @@ -138,7 +139,7 @@
}
}

if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->rights->adherent->cotisation->creer)
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->adherent->cotisation->creer)
{
$result=$object->fetch($rowid);
$result=$object->delete($user);
Expand Down Expand Up @@ -189,11 +190,11 @@

dol_fiche_head($head, 'general', $langs->trans("Subscription"), 0, 'payment');

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

$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php">'.$langs->trans("BackToList").'</a>';

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

// Ref
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td>';
print '<td class="valeur" colspan="3">';
Expand Down Expand Up @@ -287,49 +288,50 @@

print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">';

$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php">'.$langs->trans("BackToList").'</a>';

// Ref
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
print '<td class="valeur" colspan="3">';
print $form->showrefnav($object, 'rowid', $linkback, 1);
print '</td></tr>';

dol_banner_tab($object, 'rowid', $linkback, 1);

print '<div class="fichecenter">';

print '<div class="underbanner clearboth"></div>';

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

// Member
$adh->ref=$adh->getFullName($langs);
print '<tr>';
print '<td>'.$langs->trans("Member").'</td><td class="valeur" colspan="3">'.$adh->getNomUrl(1,0,'subscription').'</td>';
print '<td class="titlefield">'.$langs->trans("Member").'</td><td class="valeur">'.$adh->getNomUrl(1,0,'subscription').'</td>';
print '</tr>';

// Date record
/*print '<tr>';
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="3">'.dol_print_date($object->datec,'dayhour').'</td>';
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur">'.dol_print_date($object->datec,'dayhour').'</td>';
print '</tr>';*/

// Date subscription
print '<tr>';
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="3">'.dol_print_date($object->dateh,'day').'</td>';
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur">'.dol_print_date($object->dateh,'day').'</td>';
print '</tr>';

// Date end subscription
print '<tr>';
print '<td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur" colspan="3">'.dol_print_date($object->datef,'day').'</td>';
print '<td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur">'.dol_print_date($object->datef,'day').'</td>';
print '</tr>';

// Amount
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur" colspan="3">'.price($object->amount).'</td></tr>';
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur">'.price($object->amount).'</td></tr>';

// Amount
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur" colspan="3">'.$object->note.'</td></tr>';
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';

// Bank line
if (! empty($conf->banque->enabled))
{
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)
{
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="3">';
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">';
if ($object->fk_bank)
{
$bankline=new AccountLine($db);
Expand All @@ -346,6 +348,8 @@


print "</table>\n";
print '</div>';

print '</form>';

dol_fiche_end();
Expand Down
8 changes: 4 additions & 4 deletions htdocs/admin/dict.php
Expand Up @@ -1786,10 +1786,10 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
print '</td>';
}
elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) {
print '<td><input type="text" class="flat" value="'.price((! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')).'" size="8" name="'.$fieldlist[$field].'"></td>';
print '<td><input type="text" class="flat minwidth75" value="'.price((! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')).'" name="'.$fieldlist[$field].'"></td>';
}
elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
print '<td><input type="text" class="flat" value="'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" size="10" name="'.$fieldlist[$field].'"></td>';
print '<td><input type="text" class="flat minwidth100" value="'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'"></td>';
}
elseif ($fieldlist[$field]=='unit') {
print '<td>';
Expand Down Expand Up @@ -1829,8 +1829,8 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
{
print '<td>';
$size=''; $class='';
if ($fieldlist[$field]=='code') $size='size="8" ';
if ($fieldlist[$field]=='position') $size='size="4" ';
if ($fieldlist[$field]=='code') $class='maxwidth100';
if ($fieldlist[$field]=='position') $class='maxwidth50';
if ($fieldlist[$field]=='libelle') $class='quatrevingtpercent';
if ($fieldlist[$field]=='tracking') $class='quatrevingtpercent';
if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $size='size="2" ';
Expand Down

0 comments on commit 78bf209

Please sign in to comment.