mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Work on public form for partnership
This commit is contained in:
parent
3a5fe5063d
commit
1f59e329cd
|
|
@ -7778,7 +7778,7 @@ class Form
|
|||
*
|
||||
* @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect
|
||||
* @param array $array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...))
|
||||
* @param string|string[] $id Preselected key or preselected keys for multiselect
|
||||
* @param string|string[] $id Preselected key or preselected keys for multiselect. Use 'ifone' to autoselect record if there is only one record.
|
||||
* @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (If 1: key is -1 and value is '' or ' ', If placeholder string: key is -1 and value is the string), <0 to add an empty value with key that is this value.
|
||||
* @param int $key_in_label 1 to show key into label with format "[key] value"
|
||||
* @param int $value_as_key 1 to use value as key
|
||||
|
|
@ -7895,7 +7895,7 @@ class Form
|
|||
}
|
||||
} else {
|
||||
$id = (string) $id; // if $id = 0, then $id = '0'
|
||||
if ($id != '' && $id == $key && !$disabled) {
|
||||
if ($id != '' && ($id == $key || ($id == 'ifone' && count($array) == 1)) && !$disabled) {
|
||||
$out .= ' selected'; // To preselect a value
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ PARTNERSHIP_BACKLINKS_TO_CHECK=Backlinks to check
|
|||
PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL=Nb of days before cancelling status of a partnership when a subscription has expired
|
||||
ReferingWebsiteCheck=Check of website referring
|
||||
ReferingWebsiteCheckDesc=You can enable a feature to check that your partners has added a backlink to your website domains on their own website.
|
||||
PublicFormRegistrationPartnerDesc=Dolibarr can provide you a public URL/website to allow external visitors to request to be part of the partnership program.
|
||||
|
||||
#
|
||||
# Object
|
||||
|
|
@ -60,6 +61,11 @@ ConfirmClosePartnershipAsk=Are you sure you want to cancel this partnership?
|
|||
PartnershipType=Partnership type
|
||||
PartnershipRefApproved=Partnership %s approved
|
||||
KeywordToCheckInWebsite=If you want to check that a given keyword is present into the website of each partner, define this keyword here
|
||||
PartnershipDraft=Draft
|
||||
PartnershipAccepted=Accepted
|
||||
PartnershipRefused=Refused
|
||||
PartnershipCanceled=Canceled
|
||||
PartnershipManagedFor=Partners are
|
||||
|
||||
#
|
||||
# Template Mail
|
||||
|
|
@ -83,12 +89,6 @@ CountLastUrlCheckError=Number of errors for last URL check
|
|||
LastCheckBacklink=Date of last URL check
|
||||
ReasonDeclineOrCancel=Reason for declining or canceling
|
||||
|
||||
#
|
||||
# Status
|
||||
#
|
||||
PartnershipDraft=Draft
|
||||
PartnershipAccepted=Accepted
|
||||
PartnershipRefused=Refused
|
||||
PartnershipCanceled=Canceled
|
||||
PartnershipManagedFor=Partners are
|
||||
NewPartnershipRequest=New partnership request
|
||||
NewPartnershipRequestDesc=This form allows you to request to be part of one of our partnership program. If you need help to fill this form, please contact by email <b>%s</b>.
|
||||
|
||||
|
|
|
|||
|
|
@ -78,12 +78,14 @@ if ($action == 'update') {
|
|||
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans('PartnershipSetup');
|
||||
$help_url = '';
|
||||
//$help_url = 'EN:Module_Partnership|FR:Module_Adhérents|ES:Módulo_Miembros';
|
||||
llxHeader('', $langs->trans("PartnershipsSetup"), $help_url);
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("PartnershipsSetup"), $linkback, 'title_setup');
|
||||
print load_fiche_titre($title, $linkback, 'title_setup');
|
||||
|
||||
$head = partnershipAdminPrepareHead();
|
||||
|
||||
|
|
@ -93,7 +95,7 @@ print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
|||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
print dol_get_fiche_head($head, 'website', $langs->trans("Partnerships"), -1, 'user');
|
||||
print dol_get_fiche_head($head, 'website', $langs->trans("Partnerships"), -1, 'partnership');
|
||||
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
|
|
@ -130,7 +132,7 @@ if ($conf->use_javascript_ajax) {
|
|||
}
|
||||
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("BlankSubscriptionFormDesc").'</span><br><br>';
|
||||
print '<span class="opacitymedium">'.$langs->trans("PublicFormRegistrationPartnerDesc").'</span><br><br>';
|
||||
|
||||
$param = '';
|
||||
|
||||
|
|
@ -152,6 +154,8 @@ print '<input type="hidden" id="PARTNERSHIP_ENABLE_PUBLIC" name="PARTNERSHIP_ENA
|
|||
|
||||
print '<br>';
|
||||
|
||||
|
||||
/*
|
||||
if (!empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) {
|
||||
print '<br>';
|
||||
|
||||
|
|
@ -163,27 +167,6 @@ if (!empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) {
|
|||
print '<td class="right">'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Force Type
|
||||
$adht = new AdherentType($db);
|
||||
print '<tr class="oddeven drag" id="trforcetype"><td>';
|
||||
print $langs->trans("ForceMemberType");
|
||||
print '</td><td class="right">';
|
||||
$listofval = array();
|
||||
$listofval += $adht->liste_array(1);
|
||||
$forcetype = empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE) ? -1 : $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE;
|
||||
print $form->selectarray("PARTNERSHIP_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listofval) > 1 ? 1 : 0);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Force nature of member (mor/phy)
|
||||
$morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Moral");
|
||||
print '<tr class="oddeven drag" id="trforcenature"><td>';
|
||||
print $langs->trans("ForceMemberNature");
|
||||
print '</td><td class="right">';
|
||||
$forcenature = empty($conf->global->PARTNERSHIP_NEWFORM_FORCEMORPHY) ? 0 : $conf->global->PARTNERSHIP_NEWFORM_FORCEMORPHY;
|
||||
print $form->selectarray("PARTNERSHIP_NEWFORM_FORCEMORPHY", $morphys, $forcenature, 1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Amount
|
||||
print '<tr class="oddeven" id="tramount"><td>';
|
||||
print $langs->trans("DefaultAmount");
|
||||
|
|
@ -217,6 +200,7 @@ if (!empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) {
|
|||
print $form->selectarray("PARTNERSHIP_NEWFORM_PAYONLINE", $listofval, (!empty($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE) ? $conf->global->PARTNERSHIP_NEWFORM_PAYONLINE : ''), 0);
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
|
@ -224,6 +208,7 @@ if (!empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) {
|
|||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print '</div>';
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
|
@ -247,8 +232,8 @@ if (!empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) {
|
|||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||
|
||||
print '<div class="urllink">';
|
||||
print '<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">';
|
||||
print '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
|
||||
print '<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/partnership/new.php'.$entity_qr.'">';
|
||||
print '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/partnership/new.php'.$entity_qr.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
|
||||
print '</div>';
|
||||
print ajax_autoselect('publicurlmember');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -518,7 +518,7 @@ class Partnership extends CommonObject
|
|||
if (!empty($limit)) {
|
||||
$sql .= $this->db->plimit($limit, $offset);
|
||||
}
|
||||
|
||||
print $sql;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ function partnershipAdminPrepareHead()
|
|||
{
|
||||
global $langs, $conf;
|
||||
|
||||
$langs->load("partnership");
|
||||
$langs->loadLangs(array("members", "partnership"));
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ if (is_numeric($entity)) {
|
|||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
|
||||
|
|
@ -435,14 +436,14 @@ if (empty($reshook) && $action == 'added') {
|
|||
|
||||
$form = new Form($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
$partnershipt = new AdherentType($db);
|
||||
|
||||
$extrafields->fetch_name_optionals_label('partnership'); // fetch optionals attributes and labels
|
||||
|
||||
|
||||
llxHeaderVierge($langs->trans("NewSubscription"));
|
||||
llxHeaderVierge($langs->trans("NewPartnershipRequest"));
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("NewSubscription"), '', '', 0, 0, 'center');
|
||||
print load_fiche_titre($langs->trans("NewPartnershipRequest"), '', '', 0, 0, 'center');
|
||||
|
||||
|
||||
print '<div align="center">';
|
||||
|
|
@ -452,7 +453,7 @@ print '<div class="center subscriptionformhelptext justify">';
|
|||
if (!empty($conf->global->PARTNERSHIP_NEWFORM_TEXT)) {
|
||||
print $langs->trans($conf->global->PARTNERSHIP_NEWFORM_TEXT)."<br>\n";
|
||||
} else {
|
||||
print $langs->trans("NewSubscriptionDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL)."<br>\n";
|
||||
print $langs->trans("NewPartnershipRequestDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL)."<br>\n";
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
|
|
@ -505,25 +506,26 @@ if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE)) {
|
|||
}
|
||||
*/
|
||||
|
||||
// Moral/Physic attribute
|
||||
$morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Moral");
|
||||
if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCEMORPHY)) {
|
||||
print '<tr class="morphy"><td class="titlefield">'.$langs->trans('MemberNature').' <span style="color: red">*</span></td><td>'."\n";
|
||||
print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1);
|
||||
$partnershiptype = new PartnershipType($db);
|
||||
$listofpartnershipobj = $partnershiptype->fetchAll('', '', 1000);
|
||||
$listofpartnership = array();
|
||||
foreach ($listofpartnershipobj as $partnershipobj) {
|
||||
$listofpartnership[$partnershipobj->id] = $partnershipobj->label;
|
||||
}
|
||||
|
||||
if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE)) {
|
||||
print '<tr class="morphy"><td class="titlefield">'.$langs->trans('PartnershipType').' <span style="color: red">*</span></td><td>'."\n";
|
||||
print $form->selectarray("partnershiptype", $listofpartnership, GETPOSTISSET('partnershiptype') ? GETPOST('partnershiptype', 'int') : 'ifone', 1);
|
||||
print '</td></tr>'."\n";
|
||||
} else {
|
||||
print $morphys[$conf->global->PARTNERSHIP_NEWFORM_FORCEMORPHY];
|
||||
print '<input type="hidden" id="morphy" name="morphy" value="'.$conf->global->PARTNERSHIP_NEWFORM_FORCEMORPHY.'">';
|
||||
print $listofpartnership[$conf->global->PARTNERSHIP_NEWFORM_FORCETYPE];
|
||||
print '<input type="hidden" id="partnershiptype" name="partnershiptype" value="'.$conf->global->PARTNERSHIP_NEWFORM_FORCETYPE.'">';
|
||||
}
|
||||
|
||||
// Company
|
||||
print '<tr id="trcompany" class="trcompany"><td>'.$langs->trans("Company").'</td><td>';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
print '<input type="text" name="societe" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('societe')).'"></td></tr>'."\n";
|
||||
// Title
|
||||
print '<tr><td class="titlefield">'.$langs->trans('UserTitle').'</td><td>';
|
||||
print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'</td></tr>'."\n";
|
||||
// Lastname
|
||||
print '<tr><td>'.$langs->trans("Lastname").' <span style="color: red">*</span></td><td><input type="text" name="lastname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('lastname')).'"></td></tr>'."\n";
|
||||
// Firstname
|
||||
|
|
@ -532,18 +534,6 @@ print '<tr><td>'.$langs->trans("Firstname").' <span style="color: red">*</span><
|
|||
print '<tr><td>'.$langs->trans("Email").($conf->global->PARTNERSHIP_MAIL_REQUIRED ? ' <span style="color:red;">*</span>' : '').'</td><td>';
|
||||
//print img_picto('', 'email', 'class="pictofixedwidth"');
|
||||
print '<input type="text" name="email" maxlength="255" class="minwidth200" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
|
||||
// Login
|
||||
if (empty($conf->global->PARTNERSHIP_LOGIN_NOT_REQUIRED)) {
|
||||
print '<tr><td>'.$langs->trans("Login").' <span style="color: red">*</span></td><td><input type="text" name="login" maxlength="50" class="minwidth100"value="'.dol_escape_htmltag(GETPOST('login')).'"></td></tr>'."\n";
|
||||
print '<tr><td>'.$langs->trans("Password").' <span style="color: red">*</span></td><td><input type="password" maxlength="128" name="pass1" class="minwidth100" value="'.GETPOST("pass1", "nohtml").'"></td></tr>'."\n";
|
||||
print '<tr><td>'.$langs->trans("PasswordAgain").' <span style="color: red">*</span></td><td><input type="password" maxlength="128" name="pass2" class="minwidth100" value="'.GETPOST("pass2", "nohtml").'"></td></tr>'."\n";
|
||||
}
|
||||
// Gender
|
||||
print '<tr><td>'.$langs->trans("Gender").'</td>';
|
||||
print '<td>';
|
||||
$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"));
|
||||
print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1);
|
||||
print '</td></tr>';
|
||||
// Address
|
||||
print '<tr><td>'.$langs->trans("Address").'</td><td>'."\n";
|
||||
print '<textarea name="address" id="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1).'</textarea></td></tr>'."\n";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user