Bug 11739 - Use new DataTables include in notices template
[koha_fer] / members / memberentry.pl
index e7f07a9..3d68e49 100755 (executable)
@@ -110,7 +110,7 @@ if ( $input->param('add_debarment') ) {
         { 'dt' => dt_from_string($expiration), 'dateformat' => 'iso' } )
       : undef;
 
-    AddUniqueDebarment(
+    AddDebarment(
         {
             borrowernumber => $borrowernumber,
             type           => 'MANUAL',
@@ -313,7 +313,7 @@ if ($op eq 'save' || $op eq 'insert'){
     }
 
   if (C4::Context->preference("IndependentBranches")) {
-    if ($userenv && $userenv->{flags} % 2 != 1){
+    unless ( C4::Context->IsSuperLibrarian() ){
       $debug and print STDERR "  $newdata{'branchcode'} : ".$userenv->{flags}.":".$userenv->{branch};
       unless (!$newdata{'branchcode'} || $userenv->{branch} eq $newdata{'branchcode'}){
         push @errors, "ERROR_branch";
@@ -348,7 +348,13 @@ if ( ($op eq 'modify' || $op eq 'insert' || $op eq 'save'|| $op eq 'duplicate')
     }
 }
 
-if ( ( defined $input->param('SMSnumber') ) && ( $input->param('SMSnumber') ne $newdata{'mobile'} ) ) {
+if (
+        defined $input->param('SMSnumber')
+    &&  (
+           $input->param('SMSnumber') eq ""
+        or $input->param('SMSnumber') ne $newdata{'mobile'}
+        )
+) {
     $newdata{smsalertnumber} = $input->param('SMSnumber');
 }
 
@@ -444,7 +450,7 @@ if ($nok or !$nodouble){
 } 
 if (C4::Context->preference("IndependentBranches")) {
     my $userenv = C4::Context->userenv;
-    if ($userenv->{flags} % 2 != 1 && $data{'branchcode'}){
+    if ( !C4::Context->IsSuperLibrarian() && $data{'branchcode'} ) {
         unless ($userenv->{branch} eq $data{'branchcode'}){
             print $input->redirect("/cgi-bin/koha/members/members-home.pl");
             exit;