27require
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/partnership/class/partnership.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/partnership/lib/partnership.lib.php';
37$langs->loadLangs(array(
"companies",
"members",
"partnership",
"other"));
42$action =
GETPOST(
'action',
'aZ09');
43$confirm =
GETPOST(
'confirm',
'alpha');
44$cancel =
GETPOST(
'cancel',
'aZ09');
45$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'partnershipcard';
46$backtopage =
GETPOST(
'backtopage',
'alpha');
47$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
59$diroutputmassaction = $conf->partnership->dir_output.
'/temp/massgeneration/'.$user->id;
60$hookmanager->initHooks(array(
'partnershipthirdparty',
'globalcard'));
63$extrafields->fetch_name_optionals_label(
$object->table_element);
65$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
68$search_all =
GETPOST(
"search_all",
'alpha');
71foreach (
$object->fields as $key => $val) {
72 if (
GETPOST(
'search_'.$key,
'alpha')) {
73 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
78include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
80$permissiontoread = $user->hasRight(
'partnership',
'read');
81$permissiontoadd = $user->hasRight(
'partnership',
'write');
82$permissiontodelete = $user->hasRight(
'partnership',
'delete') || ($permissiontoadd && isset(
$object->status) &&
$object->status == $object::STATUS_DRAFT);
83$permissionnote = $user->hasRight(
'partnership',
'write');
84$permissiondellink = $user->hasRight(
'partnership',
'write');
85$usercanclose = $user->hasRight(
'partnership',
'write');
86$upload_dir = $conf->partnership->multidir_output[isset(
$object->entity) ?
$object->entity : 1];
92if (!isModEnabled(
'partnership')) {
95if (empty($permissiontoread)) {
98if ($action ==
'edit' && empty($permissiontoadd)) {
101if (($action ==
'update' || $action ==
'edit') &&
$object->status != $object::STATUS_DRAFT) {
107$result =
restrictedArea($user,
'adherent', $id,
'',
'',
'socid',
'rowid', 0);
114$parameters = array();
115$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
123if (empty($reshook)) {
126 $backtopage =
dol_buildpath(
'/partnership/partnership.php', 1).
'?rowid='.(
$id > 0 ?
$id :
'__ID__');
129 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
132$object->fields[
'fk_member'][
'visible'] = 0;
133if (
$object->id > 0 &&
$object->status == $object::STATUS_REFUSED && empty($action)) {
134 $object->fields[
'reason_decline_or_cancel'][
'visible'] = 1;
136$object->fields[
'note_public'][
'visible'] = 1;
143$form =
new Form($db);
146$title = $langs->trans(
"Partnership");
147$help_url =
"EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder";
149llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-card_partnership');
151$form =
new Form($db);
154 $langs->load(
"members");
159 if (isModEnabled(
'notification')) {
160 $langs->load(
"mails");
167 print
dol_get_fiche_head($head,
'partnership', $langs->trans(
"ThirdParty"), -1,
'user');
169 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
171 dol_banner_tab($object,
'rowid', $linkback);
173 print
'<div class="fichecenter">';
175 print
'<div class="underbanner clearboth"></div>';
176 print
'<table class="border centpercent tableforfield">';
180 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.
$object->login.
' </td></tr>';
184 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td><td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
187 print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td><td class="valeur" >'.
$object->getmorphylib().
'</td>';
191 print
'<tr><td>'.$langs->trans(
"Company").
'</td><td class="valeur">'.
$object->company.
'</td></tr>';
194 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.
$object->getCivilityLabel().
' </td>';
208if (
$object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
211 if ($action !=
'presend') {
212 print
'<div class="tabsAction">'.
"\n";
213 $parameters = array();
214 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
219 if (empty($reshook)) {
221 if ($permissiontoadd) {
222 print
dolGetButtonAction($langs->trans(
'AddPartnership'),
'',
'default', DOL_URL_ROOT.
'/partnership/partnership_card.php?action=create&fk_member='.
$object->id.
'&backtopage='.urlencode(DOL_URL_ROOT.
'/adherents/partnership.php?id='.
$object->id),
'', $permissiontoadd);
232 print
load_fiche_titre($langs->trans(
"PartnershipDedicatedToThisMember", $langs->transnoentitiesnoconv(
"Partnership")), $morehtmlright,
'');
240 $partnershipid =
$object->fetch(0,
"", $memberid);
242 if ($partnershipid > 0) {
243 print
'<div class="fichecenter">';
244 print
'<div class="fichehalfleft">';
245 print
'<div class="underbanner clearboth"></div>';
246 print
'<table class="border centpercent tableforfield">'.
"\n";
252 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
256 $fadherent->fetch(
$object->fk_member);
257 print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
258 if ($fadherent->datefin) {
260 if ($fadherent->hasDelay()) {
261 print
" ".img_warning($langs->trans(
"Late"));
264 if (!$adht->subscription) {
265 print $langs->trans(
"SubscriptionNotRecorded");
266 if ($fadherent->statut > 0) {
267 print
" ".img_warning($langs->trans(
"Late"));
270 print $langs->trans(
"SubscriptionNotReceived");
271 if ($fadherent->statut > 0) {
272 print
" ".img_warning($langs->trans(
"Late"));
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage members of a foundation.
Class to manage members type.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
member_prepare_head(Adherent $object)
Return array head with list of tabs to view object information.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.